-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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] useAutocomplete not highlighting options on hover or during arrow key traversal #32563
Comments
It looks like the |
Thanks! // v4 - useAutoComplete
const prev = listboxRef.current.querySelector('[data-focus]');
if (prev) {
prev.removeAttribute('data-focus');
} // v5 - useAutocomplete
const prev = listboxRef.current.querySelector('[role="option"].Mui-focused');
if (prev) {
prev.classList.remove('Mui-focused');
prev.classList.remove('Mui-focusVisible');
} This change was made in #26181 These demos are still relying on
Using |
Created a pull request to update the demos in #32757 |
Oops, my bad, I missed this in the review of #26181. |
@oliviertassinari it's all good! |
I've just update @mui/material(5.10.4) and @mui/base(5.0.0-alpha.96)... But arrow-keys don't highlight options. Any solutions? |
got a solution for older versions applying the following style worked for me adding the following solved my problem
check the detailed styling below :
|
Duplicates
Latest version
Current behavior 😯
Autocompletes implemented with
useAutocomplete
do not highlight the options presented in the popper when presented. Additionally, when the user attempts to select an option by using the up or down arrow key, the selected row is not highlighted.Key navigation is functional, in that the user is able to navigate to an option, press enter, and select it, but there is no visual feedback to let them know which option they've selected.
See the MUI v5 Autocomplete Demo
Expected behavior 🤔
The options should be highlighted when hovered and when the user uses the up or down arrow key while the popper is presented.
See the MUI v4 Autocomplete Demo
Steps to reproduce 🕹
Steps (see this codesandbox):
Context 🔦
I have updated a MUI v4 app to v5 and noticed the referenced deficiencies in our autocompletes.
Your environment 🌎
`npx @mui/envinfo`
I am using Chrome
The text was updated successfully, but these errors were encountered: