Fix AutoCompleteInput value does not get updated when re-selecting the same option#11254
Open
smeng9 wants to merge 3 commits into
Open
Fix AutoCompleteInput value does not get updated when re-selecting the same option#11254smeng9 wants to merge 3 commits into
smeng9 wants to merge 3 commits into
Conversation
…option with filterSelectedOptions=false When filterSelectedOptions is false, selecting an already-selected option after partially deleting the input text left the input showing the partial text until blur. MUI fires onInputChange with reason='reset' in this case but the handler only updated filterValue on user-typing events or when the new value differed from the selection. Added handling for reason='reset' with event !== null (to skip MUI's programmatic useEffect resets) and doesQueryMatchSelection (to skip create-option clicks). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Before and after video comparisons Untitled.mov |
jonathanarnault
requested changes
May 18, 2026
Contributor
There was a problem hiding this comment.
Hi @smeng9, thank you for your contribution to React Admin!
This fix looks good to me but I cannot test it right away as there are no story that highlights this fix. Can you add one ?
Also, it would be great if you used the PR template in the repository, this would help us search changes when needed.
…dOptions=false Adds a Storybook story to demonstrate and visually verify the fix for the case where re-selecting the same option after partial text deletion should immediately restore the full label without requiring a blur event. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Hi @jonathanarnault, I have updated the merge request to include stories and use the merge request template |
jonathanarnault
approved these changes
May 19, 2026
Contributor
jonathanarnault
left a comment
There was a problem hiding this comment.
LGTM, thank your for your contribution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
See original problem in #11209
Closes #11209
Solution
Add additional check for handleInputChange with the condition reason='reset'
How To Test
Tolstoy".
Additional Checks
masterfor a bugfix or a documentation fix, ornextfor a feature