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/Menu-like: investigate allowing customizing the auto-focus when menu is opened #10543

Open
thatblindgeye opened this issue Jun 6, 2024 · 1 comment

Comments

@thatblindgeye
Copy link
Contributor

thatblindgeye commented Jun 6, 2024

Describe the enhancement or change
This is a spike to investigate potential ways to allow customizing the auto-focus that occurs when a Menu/menu-like component is triggered open. Followup from an async convo on Slack in regards to #10393.

Some quick thoughts:

  • We could look into extending the new prop added to Select, shouldFocusFirstMenuItemOnOpen, to Dropdown and/or Menu
  • We could allow passing a custom element to focus for Dropdown and Select, e.g. instead of our internal click handlers that will run firstElement.focus().
  • We could update KeyboardHandler logic in Menu in some way (either trimming the list of querySelectors in the getFocusableElement prop (~line 305 of Menu file) or allowing passing a custom querySelector
  • A secret 4th option (aka whatever else may be found in investigation)

We should also consider whether any such updates should apply to all 3 of these components (Select, Dropdown, Menu), or only some, and whether we want to recommend that Dropdown/Select only have valid [Dropdown | Select]Option components, and anything more custom requires a manually/custom built Menu implementation.

Once it's decided which route to go, we should close both this and 10393, and open a new issue to iterate on a resolution.

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?

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

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

No branches or pull requests

4 participants