-
Notifications
You must be signed in to change notification settings - Fork 869
[EuiLoading] Accessibility props #4814
Description
Summary
EuiLoading needs to better communicate it's state to assistive tech. We can improve the component in two ways:
- First, add
role="progressbar"and a defaultaria-labelvalue to the loading state - Also, accept a child to handle properly setting
aria-busy
Details
Doing the first, improves the existing usage of the component. Doing the second, is a non-breaking API change that should better handle a more ideal UX.
For existing implementations, or for those that can't/don't want to upgrade to the new pattern, we should provide better documentation around aria-label and aria-busy
Documentation on aria-label should largely ask that something better than "loading content" be passed in.
Documentation on aria-busy should talk about where to put it (around the loading content) and give warnings on how it works (that it treats all children as aria-hidden) so devs don't overuse it.
In addition to accepting children to handle the aria-busy attribute setting, it'll need to also accept an isLoading prop (which is required if children are passed in).