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

Menu/Select/Dropdown - considering refactoring focus logic #11025

Open
thatblindgeye opened this issue Sep 19, 2024 · 0 comments
Open

Menu/Select/Dropdown - considering refactoring focus logic #11025

thatblindgeye opened this issue Sep 19, 2024 · 0 comments

Comments

@thatblindgeye
Copy link
Contributor

thatblindgeye commented Sep 19, 2024

Describe the enhancement or change
We should consider refactoring the focus logic in these 3 components. One suggestion that had been brought up was removing/moving focus when a Menu Item is hovered (similar to how a native select element does), but that depends if we want to go that route or keep the existing, intended behavior that more closely resembles this ARIA APG select example.

Could possibly also be partially resolved by Core/Design updates to include custom focus styling instead of relying on browser defaults (which has in part led to some confusion with these components)

Other possible suggestions:

  • Add a prop to allow consumers to customize the selectors that can be focused in the menuRef?.current?.querySelector call
  • Adding a prop to prevent autofocus on mouse click
    • This would require us to add logic to handle moving into the Menu via Up/Down arrow keys; another way would be to update the onOpenChangeKeys array to only "Escape", so that Tab could be used to get into the Menu, but Tabbing wouldn't always work depending where the menu is appended
  • Refactor the logic so that either the first selected item is focused, otherwise the first item is focused

Is this request originating from a Red Hat product team? If so, which ones and is there any sort of deadline for this enhancement?

Any other information?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

3 participants