You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Screen readers will announce tabs as either "collapsed" or "expanded" which make no sense, because aria-expanded should be used for collapsible content like accordions.
This was raised during the initial PR review, but consequently ignored.
Also, since <ul> is used as role=tablist, the list items need to be excluded from the accessibility tree so that screen readers would ignore their semantic role.
Currently the tabs are announced as "tab 1 of 1", but if you add role=none to <li> it will be announced as "1 of 3":
It looks like the aria-expanded issue has been fixed in v5.1.0 via #3292. This leaves the missing role=none on list items. I can close this issue and create a new one if that would be easier.
Bug description:
ngb-tab
uses semantically incorrectaria-expanded
attribute for tabs: https://ng-bootstrap.github.io/#/components/tabset/examplesScreen readers will announce tabs as either "collapsed" or "expanded" which make no sense, because
aria-expanded
should be used for collapsible content like accordions.ARIA guidelines recommend using
aria-selected
attribute instead: https://www.w3.org/TR/wai-aria-practices/examples/tabs/tabs-2/tabs.htmlThe Bootstrap JavaScript is correctly using
aria-selected
in this case, which is a regression for ng-bootstrap.This was raised during the initial PR review, but consequently ignored.
Also, since
<ul>
is used asrole=tablist
, the list items need to be excluded from the accessibility tree so that screen readers would ignore their semantic role.Currently the tabs are announced as "tab 1 of 1", but if you add
role=none
to<li>
it will be announced as "1 of 3":Link to minimally-working StackBlitz that reproduces the issue:
https://ng-bootstrap.github.io/stackblitzes/tabset/basic/stackblitz.html
Versions of Angular, ng-bootstrap and Bootstrap:
Angular: 7.x or 8.x
ng-bootstrap: 4.x or 5.x
Bootstrap: 4.x
The text was updated successfully, but these errors were encountered: