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

Ensure hidden TabPanel components are hidden from the accessibility tree #2708

Merged
merged 2 commits into from
Aug 28, 2023

Conversation

RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented Aug 28, 2023

This PR fixes an issue where the hidden TabPanel components are focusable in the accessibility tree and the VoiceOver cursor can access them.

Adding the aria-hidden="true" fixes this issue.

Fixes: #2688

@vercel
Copy link

vercel bot commented Aug 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2023 3:32pm
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2023 3:32pm

The `Hidden` component only adds the `aria-hidden` by default if the
`Focusable` feature is passed. In our case we don't want it to be
focusable so therefore we didn't pass this feature flag.

Because we didn't pass the `Focusable` feature, the `display: hidden`
was used which makes it completely unfocusable to the keyboard of the
user which is what we want.

However, the VoiceOver cursor _can_ get into those elements. Adding the
`aria-hidden` manually to these tabs solves the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inactive tabpanels aren't hidden from the accessibility tree.
1 participant