Question: Why is Tab.Panel focusable by keyboard? #1433
Replies: 4 comments 6 replies
-
Hey! We did it because as far as I understand it’s a requirement to make tabs accessible to people using assistive technology: https://www.w3.org/TR/wai-aria-practices/examples/tabs/tabs-1/tabs.html If it’s actually optional though definitely open to making it configurable somehow. |
Beta Was this translation helpful? Give feedback.
-
I was also surprised with this (also because I didn't know that I have to style the outline on a panel to match other outlines in my app). So +1 on making this configurable. |
Beta Was this translation helpful? Give feedback.
-
@adamwathan I was also surprised by this, and the inability to configure so tab panel is not focusable. It agree with others that the spec linked to above to indicates that this capability should be supported. My use-case is similar to @carlesandres: the tab panel bodies contain focusable elements. Therefore it is most reasonable for the next tab index to be on a focusable element within the open tab panel body vs. the overall tab panel itself. The w3 example on codepen (linked to above) shows tabs with prose in them only. In that example case, I agree, it makes sense for next tab focus is the tab panel itself. Noting Behaviour that's Arguably A Bug I would argue that the current behaviour of To me, support for I'd be happy to turn this into a bug report if others agree. (by the way this is related to a dev experience issue with other HeadlessUI components as well where props are accepted but then do not work at all or as expected -- tighter types could help make the library easier to use and require less time in docs + examples). Real Use-Case / Scenario Example
I think it is potentially confusing to users and not particularly "app like" to have focus go from the tab to the entire Incidentally this project is for an extremely physical mobility impaired user where any extra step would be a genuine hassle!! However... the interface I was working on when I encountered this is for caregivers who have more mobility :-). The big picture definitely keeps these sorts of things top-of-mind though! |
Beta Was this translation helpful? Give feedback.
-
Also in Vue it does not work perfectly to disable tabbing and there is a broken edge case: #2110 |
Beta Was this translation helpful? Give feedback.
-
I noticed the tab content panel itself is given a
tabindex
, so if you start focused on a tab and press Tab, it initially focuses the entire panel container. You have to press Tab a second time to focus on the first item inside the panel:Untitled.mov
Why is this? Just curious, as it seems like a pointless interim step, and possibly a confusing one. It's not clear to me what the intention of 'focusing' the panel container would be in the above example, since there is nothing you can 'do' with the panel container, as it's not a link or form control or similar. All you can 'do' is proceed to tab to the first item inside it.
For cases where the tab panel content is just one or more keyboard-navigable children (as is fairly common, as in the example above), would it make more sense to remove the tabindex from the tab panel itself so the user is immediately taken to the first focusable item within the tab panel? Or do accessibility standards require the panel container itself always to be tabbable, and if so why? Or is there just some practical benefit I'm missing?
Beta Was this translation helpful? Give feedback.
All reactions