primeng icon indicating copy to clipboard operation
primeng copied to clipboard

[Accessibility] - TabView component related Accessibility issues

Open ramji-seetharaman opened this issue 6 years ago • 5 comments

I'm submitting a ... (check one with "x")

[X] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports) https://stackblitz.com/edit/primeng-tabview-styling?file=src%2Fapp%2Fapp.component.html

Current behavior

  • The keyboard paradigm for the tab structure is not proper. The arrow keys needs to move between the link in the tablist and tab key takes the user to the tabpanel that is currently active. Arrow keys (Left, Right) arrow must move through the tabs. Tab keys must not be used to move around the tabs. First time activating the tab key moves focus into the tablist and then into the tabpanel that is active.
  • The default value for aria-selected as per specifications is undefined. When the page is rendered, for all the tabs other than the one that is selected, the aria-selected attribute is not present. Only when the links are activated, the aria-selected is set dynamically. Dynamically adding the aria-selected attribute using JavaScript causes unexpected rendering of information to screen readers.
  • Tabindex attribute is set on the wrong element (
  • ) which will not communicate the necessary information. The role="tab" is set on the links, so when focus moves the tab related ARIA role is not exposed to Screen readers. Focus must be set on the link inside of the list item.

Expected behavior

  • The keyboard paradigm for the tab structure can be found in the following link. Please follow the "Keyboard Support" in this link: https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-2/tabs.html or "https://whatsock.com/tsg/Coding%20Arena/ARIA%20and%20Non-ARIA%20Tabs/ARIA%20Tabs%20(Internal%20Content)/demo.htm"
  • Initially, for all the tabs other than the one selected, the aria-selected value needs to be present in the DOM and value needs to be set to false. After that using JavaScript, the value of the aria-selected needs to be toggled to either false on true based on the interaction. This way when screen reader navigates to the page, valid information is communicated to screen readers.
  • The tabindex="0" should be set on the container which has the role="tab". Remove tabindex="0" from the
  • and place it on the which has the role set to tab.

Minimal reproduction of the problem with instructions

  • Go to the documentation for PrimeNG TabView in the official website
  • For any of the examples, verify whether the keyboard interactions are proper. Make sure that arrow keys (Left, Right arrow) is used to move between the tabs. Tab key must first move focus into the first tab in the tablist. Activating the tab keystroke again needs to move focus into the tabpanel content. Enter activates the tab and Home/End keystroke moves focus to the first and last tab respectively.
  • Turn on JAWS/VoiceOver depending on whether using Windows/Mac
  • Verify whether the state (selected/unselected) of the tabs is properly communicated to screen readers. With respect to keyboard, TAB for the first time moves focus to the selected tab and the second time TAB is activated, focus moves to the tabpanel (provide tabindex="0") for the active tab.
  • Navigate through the tablist using keyboard interactions (Tab, Shift + Tab) and make sure only interactive elements receive keyboard focus

What is the motivation / use case for changing the behavior? Inclusion and equal access needs to be provided for all components. People with motor impairments and users with vision impairments will currently have barriers to properly interact with the component. Accessibility needs to be considered before building any component, so addressing these issues accounts for people with disabilities to have equal access to the components.

Please tell us about your environment: Windows 10/ VS Code/ NPM/ JAWS 2020 Mac OS/ VS Code/ NPM/ VoiceOver

  • Angular version: 5.X 8.2.3

  • PrimeNG version: 5.X 8.2.9lts

  • Browser: All

  • Language: [all | TypeScript X.X | ES6/7 | ES5]

  • Node (for AoT issues): node --version = 8.9.4 Tab related issues PrimeNG

@yigitfindikli - Is this planned to be worked on anytime soon?

ramji-seetharaman avatar Jun 23 '21 21:06 ramji-seetharaman

@ramji-seetharaman Thanks for raising this issue, need this feature to support accessibility.

eirenaios avatar Jul 09 '21 06:07 eirenaios

It's also speaking spacebar when using Jaws. image https://getbootstrap.com/docs/5.1/components/navs-tabs/#javascript-behavior

Vyeche avatar Nov 23 '21 22:11 Vyeche

Two years later, and accessibility for the tab control is still poor. Issues I have navigating with keyboard:

  • Selecting a tab does not allow me to enter the contents of a tab.
  • If there is more than one tab, there is no way to navigate out of the tab. (Pressing tab does nothing when you reach the last control)

thelongshot avatar Jul 08 '22 17:07 thelongshot

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap? Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!

Best Regards,

mertsincan avatar Nov 09 '22 20:11 mertsincan