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

Non-ideal ARIA tabs use #370

Open
aardrian opened this issue May 18, 2024 · 2 comments
Open

Non-ideal ARIA tabs use #370

aardrian opened this issue May 18, 2024 · 2 comments
Labels

Comments

@aardrian
Copy link

Using the Accessibility page from the latest (2023) survey, the ARIA tabs pattern is not being used ideally.

Each tablist on the page contains only a single tab. You can confirm that there are 5 instances of tablist on the page:

//*[@role="tablist"][contains(//*[@role],"tab")]

And you can confirm there are a total of 5 tabs on the page (one in each tablist):

//*[@role="tablist"]//*[@role="tab"]

While ARIA does not disallow single-tab tablists, the user expectation is that a tabbed interface will provide them with choice. Given that each tab has an interactive control immediately following it, the visual and programmatic structure could lead a user to believe that button is another tab. Given there are also 5 instances (one for each tablist), the correlation is reasonable:

//*[@role="tablist"]/following-sibling::button

In addition, 2 of the 7 tabpanels on the page have invalid accName references:

//*[@role="tabpanel"][@aria-labelledby="radix-:Rlah:-trigger-tab-0"]
//*[@role="tabpanel"][@aria-labelledby="radix-:R25ah:-trigger-tab-0"]

This further confuses the pattern for screen reader users.

I encourage you to either remove the tabs pattern when there is only one option or to confirm with your users that this is not a point of confusion. And to fix the accName references. And to dump the pattern completely on the "Recommended Resources" promo box.

@SachaG SachaG added the a11y label May 20, 2024
@SachaG
Copy link
Member

SachaG commented May 20, 2024

This is because A) some charts do have more than one tab (see Demographics section) and B) users can themselves add custom tabs. So I think it might be an acceptable downside to use that tabs pattern even when there is only a single tab? I mean, visually at least that's what we do, to convey the fact that more tabs are a possibility.

I'll look into the accName thing.

@aardrian
Copy link
Author

The need to reserve space for more tabs, and to be consistent with the pattern throughout the site, is fair.

But definitely drop it from the "Recommended Resources" promo box since it doesn't appear a user can add tabs and I didn't see tabs on similar "Recommended Resources" promo boxes elsewhere in the site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants