Add tabindex="0"
whenever .overflow-*-{auto|scroll}
are used for a11y
#38963
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds
tabindex="0"
whenever.overflow-*-{auto|scroll}
are used in the documentation or examples.This ensures that the area is focusable with the keyboard on Chrome for instance.
We might add a note in the overflow utilities page about why
tabindex="0"
is needed 🤷Motivation & Context
Boosted runs axe tests automatically. With the latest
axe-core
version (4.7.2
), new tests have their impacts changed to serious and are now caught by ourpa11y-ci
:Here's the report on our side (which is the same as in Bootstrap):
To understand the error, please go to https://codepen.io/julien-deramond/pen/bGQxKej with Chrome and you'll see that without tabindex="0" the area isn't focusable with the keyboard. So the idea to fix it is to add this tabindex="0" where needed as explained by https://dequeuniversity.com/rules/axe/4.7/scrollable-region-focusable?application=axeAPI.
More context on Boosted side: Orange-OpenSource/Orange-Boosted-Bootstrap#2162 (comment)
ℹ️ Another PR will come to fix the
.table-responsive
usage in the same spiritType of changes
Checklist
npm run lint
)Live previews