Open TrevorRice opened 2 years ago
In the meantime, a workaround for this seems to be to use a render callback in order to conditionally load the MenuList
/MenuItems
based on whether or not isExpanded
is true.
I think this works because the portal isn't created until it's actually needed to render, and thus it's not present yet to pick up the aria-hidden
attribute that gets spread around everywhere when the dialog is first opened.
🐛 Bug report
Current Behavior
When a component that leverages a portal is passed as a child to
Dialog
, the content rendered outside of theDialog
's DOM tree is hidden from assistive technologies viaaria-hidden
.https://user-images.githubusercontent.com/3644075/144095068-e23d6562-7603-4d31-9f39-b82e83fc71af.mov
The second half of the recording demonstrates what happens when a
Menu
component is passed as a child toDialog
. You'll notice the options are no longer read by VoiceOver.Expected behavior
For "portaled" content not to be hidden from assistive technologies.
Reproducible example
CodeSandbox
Suggested solution(s)
I believe this would mean not applying
aria-hidden="true"
to containers that render the portal's content.Additional context
N/A
Your environment
@reach/dialog