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 Button & Listbox Button: overlay does not collapse when focus returns to button #107

Open
ianmcburnie opened this issue Nov 3, 2022 · 2 comments · May be fixed by #191
Open

Menu Button & Listbox Button: overlay does not collapse when focus returns to button #107

ianmcburnie opened this issue Nov 3, 2022 · 2 comments · May be fixed by #191
Assignees
Labels
enhancement New feature or request

Comments

@ianmcburnie
Copy link
Member

Currently when we shift tab from the listbox or menu item back to the button, the overlay stays open. I believe this was by design originally, but in retrospect I think it would probably make more sense if the overlay collapses (and can then easily be opened by SPACEBAR/ENTER again). Let's investigate.

@ianmcburnie ianmcburnie added the enhancement New feature or request label Nov 3, 2022
@ianmcburnie ianmcburnie self-assigned this Nov 3, 2022
@ianmcburnie ianmcburnie removed their assignment Nov 28, 2022
@saiponnada
Copy link
Contributor

Currently the menu button in APG, auto closes when we shift the focus back. I do not see any reason not to do this with listbox-button as well.

https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/examples/menu-button-actions-active-descendant/

How about exposing a configurable option (by default set to true) something like this - autoCollapse: true? or is autoCollapse too generic?

@saiponnada saiponnada self-assigned this Oct 23, 2024
@ianmcburnie
Copy link
Member Author

I think we use 'autoCollapse' in a few other places, typically for when the focus leaves the entire widget. But here, the button is technically still part of the widget.

We might not need to add a configuration option at all. If we feel that menu-button and listbox-button should always collapse when focus moves back to button let's just make that the behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants