rstacruz / nprogress

For slim progress bars like on YouTube, Medium, etc
http://ricostacruz.com/nprogress
MIT License
25.99k stars 1.81k forks source link

Invalid ARIA roles #180

Open robdodson opened 7 years ago

robdodson commented 7 years ago

I was recently looking through a list of the most used ARIA roles according to HTTP Archive and found that the 15th most common one is role="bar". Doing some BigQuery sleuthing I discovered that much of the usage may be coming from this library.

To my knowledge, ARIA doesn't support a role of either bar or spinner. A full list of roles can be found here. My concern is that, from the accessibility side of things, it may be teaching folks to use roles which don't convey any meaningful information to assistive technology like a screen reader.

There is a progressbar role, which seems closer to what you're after. I guess since a spinner is a kind of indeterminate progressbar you could also use that role, combined with the recommendation from the spec:

The author should supply values for aria-valuenow, aria-valuemin, and aria-valuemax, unless the value is indeterminate, in which case the author should omit the aria-valuenow attribute.

nmackey commented 6 years ago

For anyone that finds this in the future I have forked this repo and created accessible-nprogress that adds accessibility support for this library. - https://github.com/nmackey/accessible-nprogress