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 default aria-label value 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).
Summary
EuiLoading needs to better communicate it's state to assistive tech. We can improve the component in two ways:
role="progressbar"and a defaultaria-labelvalue to the loading statearia-busyDetails
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-labelandaria-busyDocumentation on
aria-labelshould largely ask that something better than "loading content" be passed in.Documentation on
aria-busyshould talk about where to put it (around the loading content) and give warnings on how it works (that it treats all children asaria-hidden) so devs don't overuse it.In addition to accepting children to handle the
aria-busyattribute setting, it'll need to also accept anisLoadingprop (which is required ifchildrenare passed in).