-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Inactive tabpanels aren't hidden from the accessibility tree. #2688
Comments
Hey, what version of macOS and Chrome are you using? While I see that they show up in the accessibility tree — VoiceOver doesn't navigate over to those tab panels or even mention their existence for me. |
Chrome: 116.0.5845.110 Strangely, I'm seeing inconsistent behavior: sometimes I get tab-panel announcements (in which case the problem I reported seems to always arise—i.e., even the inactive tab-panels get announced), and sometimes I get no tab-panel announcement at all like you reported (which also doesn't seem right). I wonder if the iframe is somehow to blame for the inconsistency, though, because on another project I'm working on (without iframe) I get the "announce all tab-panels" behavior every time. |
Well I tried it outside of the iframe by navigating to the example on the website directly (currently happens to be here: https://headlessui.com/examples/react-tabs-hero — but it's not meant to be viewed outside of the page so the styling looks strange viewing it directly) I'm on Chrome 116.0.5845.96 which is a hair behind you so maybe it's related to some patch to Chrome. I'll restart it and give it another look. I'm also on macOS 13.5.1 so I don't know if that's also related — I'll keep poking at it to see if I can reproduce it. |
I'll try to find time this week to put together a public repository that I can to link to here. (Like I said, it's happening consistently in the project I'm working on.) Also, I think I can consistently reproduce the behavior on https://headlessui.com/examples/react-tabs-hero by first using the keyboard to Tab to the tab-list and then hitting ←/→ to change which tab is selected, before using VO to move to the tab-panel: Screen.Recording.2023-08-23.at.4.29.46.PM.mov |
Given that you can reliably reproduce it on the example a repro probably isn't necessary since that is the repro :D I tried with an updated Chrome and didn't see any change in behavior. One interesting thing is that chrome reports the size of these as 1x0 and I wonder if something changed in macOS recently to ignore "invisible" things in VoiceOver. I'll spin up a VM with 13.3 and see. 🤔 In anywise it's obviously an issue. I'm not sure why we don't have |
Okay, I won't bother with the reproduction then! The "visually-hidden" approach to inactive tab-panels strikes me as a little funky. My instinct would be to just go In any case, my guess is that just adding |
Hey, thank you for this bug report! 🙏 This should be fixed by #2708, and will be available in the next release. You can already try it using:
|
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
v1.7.17
What browser are you using?
Chrome
Reproduction URL
The problem is evident in the example at the top of this page from the docs, so I hope you won't mind if I don't go to the trouble of making a repo for this purpose.
Describe your issue
Inactive tabpanels aren't hidden from the accessibility tree. As a result, screen-readers announce them, which is undesired behavior.
If I'm not mistaken, the problem stems from changes made in #1837. Perhaps simply adding
aria-hidden="true"
to the inactive tabpanelspan
-elements would fix this?The video below demonstrates the problem (using VoiceOver on Chrome on Mac). You can see that VO announces the inactive "Popular" and "Trending" tabpanels after the active "Recent" tabpanel.
Screen.Recording.2023-08-21.at.9.10.57.AM.mov
The text was updated successfully, but these errors were encountered: