-
Notifications
You must be signed in to change notification settings - Fork 355
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
How to deal with disabled tabs in an automatically activated tablist #1237
Comments
@talimarcus wrote:
Good point; we should add language to the pattern to address this.
Perhaps we could clear up the confusion. If the user moves focus to a disabled tab, the tabpanel content would not change. The currently displayed tab would still have aria-selected true and the tab with focus would have aria-disabled set to true. The design should clearly indicate that the tab is disabled as well as indicate which tab is selected. So, in this instance, the selection indicator needs to be distinctly different from the focus indicator. In that way it is similar to the manually activated tabs. But, I don't think it confuses the automatic paradigm. Once focus lands on a tab that is not disabled, then that tab should be selected and displayed. The reason for keeping the disabled tab focusable is so its presence is more readily perceivable by screen reader users who are operating in the interaction mode, e.g., JAWS forms mode or NVDA focus mode, of their screen reader. If the presence of the disabled tab is not useful information, you could choose not to make it focusable. However, in that case, I would argue that it might be better to hide it completely so that it is not perceived by any user.
Displaying an empty tabpanel could be another option, but sounds kind of strange. Maybe another option is a tabpanel that explains why the tab is disabled, e.g., do X to see Y here. |
A look at the documentation shows we have no text at all about disabled tabs. Not in the example, nor the APG, or the ARIA spec. If it’s advisable to keep disabled tabs in the focus order we should definitely add a note about that. There’s also nothing about disabled tabs in the code for the code examples. Which as far as I can tell means we currently have no support for disabled tabs whatsoever. @mcking65 I can fix the code but need to know what happens in certain situations. If you have focus set to the active tab in the tablist and you press right arrow. But the next tab is disabled. Should focus be set to that or the first available non-disabled tab? |
I would prefer this variant:
I don't think the following is a good solution:
It would mean to show AT users something different than mouse users. |
I agree that the first variant seems like the best way to handle this. I wonder if some of the confusion here comes from the fact that the "automatic activation" pattern ties focus to activation ( And since @talimarcus brought this up the other day, I also started wondered about it in the context of a single-select In other words, if a user presses the down arrow in a
The three things that happen should be:
|
Listboxes with the HTML elements |
Does anyone have an example of a disabled tab out in the wild? Preferably a native UI. I’ve never seen this and would like to do some tests. Right now I’m inclined to agree with @JAWS-test—disabled controls are usually skipped unless the user lands on them via linear navigation. For tabs I like @mcking65’s suggestion to include them in the arrow navigation to make them more discoverable, too.
|
Our own guidance about when to make disabled controls focusable says that disabled options in a listbox should be focusable. That implies that we want the ARIA behavior to be different from the native widget pattern. I personally think that's a good idea because there's a lot to dislike about The four items that we recommend be focusable when disabled are:
It'd be good if we either explained why those four patterns are singled out or removed that point entirely. The general guidance seems good enough for authors to make a decision about when discoverability of disabled items is helpful to users. Either way, the question of how you implement "disabled but focusable" still seems worthwhile even if there are reasons you shouldn't do it most/some of the time. |
According to the WAI-ARIA Authoring Practices, tab elements in a set of tabs should still be focusable when disabled:
However, this is at odds with the automatic activation pattern of tabs, which automatically displays a tab’s associated tabpanel on focus:
The problem we're running into is that if a tab is disabled, then its associated tabpanel should not be displayed on focus. This is possible with manually activated tabs, because you can focus on a tab without activating that tab. However with automatically activated tabs, each tab is, by definition, activated upon focus. Pardon the repetition, but this means that in an automatically activated tablist, if we focus on any tab, including a disabled tab, that tab will be activated and its associated tabpanel will be displayed. But the whole point of disabling a tab is to ensure the tab cannot be activated. It seems like the automatic activation pattern is at odds with the guidance to make disabled tabs focusable.
I discussed this a bit with @sh0ji and he said:
In my opinion, this is a confusing mixing of two paradigms (manual and automatic activation).
The only solution I can think of that doesn't mix the manual/automatic activation paradigms and respects the need to keep all tabs focusable is to still activate a disabled tab on focus, but hide the contents of the associated tab panel somehow. I'd appreciate any other suggestions or guidance on this.
The text was updated successfully, but these errors were encountered: