Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Console] Fix choice autocomplete issue when string has spaces#62827

Merged
nicolas-grekas merged 1 commit into
symfony:6.4from
ayyoub-afwallah:fix/console-choice-autocomplete-has-spaces
Dec 22, 2025
Merged

[Console] Fix choice autocomplete issue when string has spaces#62827
nicolas-grekas merged 1 commit into
symfony:6.4from
ayyoub-afwallah:fix/console-choice-autocomplete-has-spaces

Conversation

@ayyoub-afwallah
Copy link
Copy Markdown
Contributor

@ayyoub-afwallah ayyoub-afwallah commented Dec 19, 2025

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #62814
License MIT

Choice = "a test"

Typing "a ", pressing SPACE suggests "a test" (extra space), then TAB to autocomplete results in "a test" (the extra space is included).
image

The autocomplete logic was trimming the entered value before calculating what to append, ignoring the space the user already typed.

Fix: use the actual entered value length (including spaces).

Also extracted variables for better readability.

@HypeMC
Copy link
Copy Markdown
Member

HypeMC commented Dec 20, 2025

I've checked, and the issue is also present in version 6.4. Bug fixes should target the lowest maintained version that has the issue. Also, could you please cover this case with a test?

@ayyoub-afwallah ayyoub-afwallah force-pushed the fix/console-choice-autocomplete-has-spaces branch from 5fc68a7 to c0ce860 Compare December 20, 2025 11:00
@ayyoub-afwallah ayyoub-afwallah changed the base branch from 7.4 to 6.4 December 20, 2025 11:00
@ayyoub-afwallah ayyoub-afwallah force-pushed the fix/console-choice-autocomplete-has-spaces branch from c0ce860 to db30330 Compare December 20, 2025 11:12
@ayyoub-afwallah
Copy link
Copy Markdown
Contributor Author

I've checked, and the issue is also present in version 6.4. Bug fixes should target the lowest maintained version that has the issue. Also, could you please cover this case with a test?

Done! also, can you please add a bug label ? thank you

@nicolas-grekas nicolas-grekas modified the milestones: 7.4, 6.4 Dec 22, 2025
@nicolas-grekas nicolas-grekas force-pushed the fix/console-choice-autocomplete-has-spaces branch from db30330 to fdb3375 Compare December 22, 2025 08:13
@nicolas-grekas
Copy link
Copy Markdown
Member

Thank you @ayyoub-afwallah.

@nicolas-grekas nicolas-grekas merged commit cec7fb8 into symfony:6.4 Dec 22, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants