-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Autocomplete] the first option is not highlighted for autoHighlight using filterOptions #36336
Comments
@sai6855 thanks for your reply. I'm not sure of #29508 well but https://mui.com/material-ui/api/autocomplete/#props
The current behavior looks weird to me. Also I wrote as a footnote, in the example to reproduce This is unnatural. I don't think it's expected behavior. |
i think this applies only on initial render of listbox.
yes you right, there is bug somewhere. i think this issue is related to #33634 |
I suppose we can only run the highlight restoration logic when the options change without changing the input. It's how browser address fields work. |
Is there any update on this issue? I'd like to fix it if no one has started. |
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example: https://codesandbox.io/s/mui-autocomplete-bug-forked-vj99f8?file=/src/AutocompleteDemo.js:1001-1026
Steps:
Current behavior 😯
With v5.11.10, The 4th item, "Goodfellas", is highlighted.
Expected behavior 🤔
With v5.11.6, the 1st item is highlighted expectedly.
Context 🔦
I'm using Fuse for fuzzy searching in
filterOptions
.autoHighlight says:
Currently it behaves unintentionally when Fuse sorts the order of the options.
If I replace Fuse with simple
match
, it works well. The 1st option is highlighted.I'm feeling this issue happens when the order of the given options is changed in
filterOptions
.It worked with v5.11.6 as I wrote as Expected behavior.
Your environment 🌎
I'm using Chrome 110.0.5481.177.
npx @mui/envinfo
Footnotes
When type enter, "The Godfather" is selected :-) ↩
The text was updated successfully, but these errors were encountered: