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
Labels

Comments

@thatblindgeye
Copy link
Contributor

thatblindgeye commented Sep 19, 2024

Describe the enhancement or change
Following the update that added arrow key handling on menus, this issue could be refined for the following tweaks:

  • Add a prop to allow consumers to customize the selectors that can be focused in the menuRef?.current?.querySelector call when shouldFocusFirstItemOnOpen is true. This would cover use cases where there's a filter search before the actual menu content for example.
  • Refactor the logic so that either the first selected item is focused, otherwise the first item is focused. This would be for Select or a custom Menu implementation that is essentially a select. A related prop (shouldFocusSelectedItem) would also be useful.

This could be worth a spike to see whether the existing API could be simplified in any way, e.g. combining similar props into its own interface, similar to CarHeader and its actions prop, or how complicated either of the above items may be to implement.

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
Projects
Status: Backlog
Development

No branches or pull requests

3 participants