Skip to content
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] differentiate between hover and keyboard highlight states #33577

Closed
wants to merge 1 commit into from

Conversation

cjtroiano
Copy link

I would have liked to use css for the mouse "cursor", but I wasn't able to test it properly.
If thats preferred, then I could use some help on detecting that in a test.

fix #23916

@mui-bot
Copy link

mui-bot commented Jul 19, 2022

Details of bundle changes

Generated by 🚫 dangerJS against c819bc2

@michaldudak michaldudak added the component: autocomplete This is the name of the generic UI component, not the React module! label Oct 12, 2022
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 8, 2022
@michaldudak
Copy link
Member

michaldudak commented Dec 7, 2022

Hi @cjtroiano. Sorry it took us so long to get to review your PR.
Regarding the implementation - I don't think having .Mui-focused and .Mui-focusVisible on different elements is the best solution. If we're going with the pattern used by Chrome's omnibox, I think that styling elements on hover with CSS should be enough.
What I'm worried about, though, is that it'll change the behavior in existing applications, and there may be developers relying on the current behavior.

We may need to wait until v6 before we fix it this way.

Two things that come to my mind that we can do today:

  1. put this behavior behind a prop (disableHighlightOnHover) that's false by default
  2. expose the highlightedItem as a controlled prop. This way, it will become possible for developers to decide when a highlight should be changed

cc @mnajdova for thoughts

@mnajdova
Copy link
Member

  1. put this behavior behind a prop (disableHighlightOnHover) that's false by default

Agree, we should do this as part of this PR, in v6 we could make this default behavior and drop the prop.

  1. expose the highlightedItem as a controlled prop. This way, it will become possible for developers to decide when a highlight should be changed

Agree, we can anyway do this regardless of the previous implementation. Having a controlled prop for it sounds reasonable.

@einvalentin
Copy link

Hey! Thanks @mnajdova - quick question - is there an issue that I could track when this is done? :) Right now it causes a small regression for our project. No show stopper, but it would be good to be able to see when to update the library 👍🏽

@mnajdova
Copy link
Member

mnajdova commented May 5, 2023

@einvalentin I can prioritize reviewing it if we have a contribution from the community, but I have no bandwidth to do it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: autocomplete This is the name of the generic UI component, not the React module! PR: out-of-date The pull request has merge conflicts and can't be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Autocomplete] Differentiate hover & keyboard states
6 participants