You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a Menu component contains an option that triggers a Dialog, screen readers do not detect the opening of the dialog component.
This appears to be due to the fact that Menu.Items returns focus to the Menu.Button when it closes, and therefore the screen reader instead reads that focus action.
Our workaround currently has been to wait for the next tick before opening the dialog:
// before<Menu.Item><buttononClick={()=>setIsOpen(true)}.../></Menu.Item>// after <Menu.Item><buttononClick={()=>setTimeout(()=>setIsOpen(true),0)}.../></Menu.Item>
The text was updated successfully, but these errors were encountered:
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
v1.6.5
What browser are you using?
Chrome w/ macOS Voice Over, and Chrome Screen Reader
Reproduction URL
https://stackblitz.com/edit/headlessui-dialog-a11y-bug
(If a git repo is required too just let me know)
Describe your issue
When a
Menu
component contains an option that triggers aDialog
, screen readers do not detect the opening of the dialog component.This appears to be due to the fact that
Menu.Items
returns focus to theMenu.Button
when it closes, and therefore the screen reader instead reads that focus action.Our workaround currently has been to wait for the next tick before opening the dialog:
The text was updated successfully, but these errors were encountered: