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

Accessibility | TabView - TabIndex order doesn't follow the W3C recommended pattern #13421

Closed
GiacomoDM opened this issue Aug 2, 2023 · 2 comments · Fixed by #13423
Closed
Labels
Component: Accessibility Issue or pull request is related to WCAG or ARIA Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@GiacomoDM
Copy link
Contributor

Describe the bug

As stated in the W3C Authoring Practices Guide, for a Tab interface the tab button should behave as follow:

  • When focus moves into the tab list, places focus on the active tab element.
  • When the tab list contains the focus, moves focus to the next element in the page tab sequence outside the tablist, which is the tabpanel unless the first element containing meaningful content inside the tabpanel is focusable.

Check: https://www.w3.org/WAI/ARIA/apg/patterns/tabs/#keyboardinteraction for reference.

To be compliant with WCAG, all the patterns should be applied.

Environment

Windows

Reproducer

https://primeng.org/tabview

Angular version

16.X

PrimeNG version

16.1.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

16.20

Browser(s)

No response

Steps to reproduce the behavior

  • Set focus to a tab header in any of the examples
  • Press tab
  • The focus moves to the next tab header

Expected behavior

Pressing tab, the focus should move inside the content of the selected tab, if focusable, or to the next focusable element of the page.

@GiacomoDM GiacomoDM added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 2, 2023
GiacomoDM added a commit to GiacomoDM/primeng that referenced this issue Aug 2, 2023
@rosenthalj
Copy link
Contributor

Is GitHub's tab interface working the same way as PrimeNG?

GitHubTabs.mov

@GiacomoDM
Copy link
Contributor Author

GiacomoDM commented Aug 3, 2023

Is GitHub's tab interface working the same way as PrimeNG?

GitHubTabs.mov

You are right, but the HTML structure of GitHub's page doesn't have the role="tablist" and role="tab" that PrimeNG correctly has.

image

These roles tells the screen reader that the element's behaviour is the Tab view's one, for which there is the recommended W3C pattern.

@GiacomoDM GiacomoDM changed the title [A11Y] Component: TabView - TabIndex order doesn't follow the W3C recommended pattern Accessibility | TabView - TabIndex order doesn't follow the W3C recommended pattern Aug 4, 2023
@cetincakiroglu cetincakiroglu added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Aug 7, 2023
@cetincakiroglu cetincakiroglu added this to the 16.1.1 milestone Aug 7, 2023
@cetincakiroglu cetincakiroglu added the Component: Accessibility Issue or pull request is related to WCAG or ARIA label Aug 7, 2023
GiacomoDM added a commit to GiacomoDM/primeng that referenced this issue Aug 7, 2023
cetincakiroglu added a commit that referenced this issue Aug 10, 2023
cetincakiroglu added a commit that referenced this issue Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Accessibility Issue or pull request is related to WCAG or ARIA Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants