[Autocomplete] freeSolo value always changes to first matching item when you modify previous match #27137
Open
2 tasks done
Labels
bug 🐛
Something doesn't work
component: autocomplete
This is the name of the generic UI component, not the React module!
Autocomplete will not update value for
freeSolo
if you delete text from a previous match and hitenter
. Instead the select always interprets theenter
key as selecting the first option.Current Behavior 😯
Select menu takes over and selects first item on
enter
instead of accepting the customfreeSolo
text after modification. Hittingesc
on the keyboard to force menu shut is the only way to make it work without further modification.Expected Behavior 🤔
Expect that hitting
enter
with custom text changes the value to that text whenfreeSolo
option is enabled.Steps to Reproduce 🕹
Forked off the demo material-ui
freeSolo
example. Only changes being that value shown and second example removed.https://codesandbox.io/s/material-demo-forked-w902w
enter
freeSolo
)enter
and the value changes to "The Redemption"As you can see we used two paths to try to update the text value to "Shawshank Redemption" and the user would expect both (step 3 and step 5 to work the same).
Context 🔦
Consistent value setting for users.
Your Environment 🌎
The text was updated successfully, but these errors were encountered: