instacart / Snacks

The Instacart Component Library
https://instacart.github.io/Snacks/
Apache License 2.0
81 stars 36 forks source link

[A11y] Prevent tabbing to aria-hidden menu items #398

Closed mmarcuccio closed 4 years ago

mmarcuccio commented 4 years ago

Currently if a Menu is aria-hidden, you can still tab to its child menu items. aria-hidden="true" does not hide focusable elements from screen reader or keyboard users as TAB key navigation ignores this attribute.

This PR sets a tab-index of -1 to all child menu items of an aria-hidden menu.

codecov[bot] commented 4 years ago

Codecov Report

Merging #398 into master will not change coverage. The diff coverage is 100%.

@@           Coverage Diff           @@
##           master     #398   +/-   ##
=======================================
  Coverage   83.84%   83.84%           
=======================================
  Files          62       62           
  Lines        1300     1300           
  Branches      230      230           
=======================================
  Hits         1090     1090           
  Misses        159      159           
  Partials       51       51