ARIA 1.1: aria-level is required with role="heading"
See original GitHub issueHello and thank you for this excellent package!
I ran axe-core
testing against a component of mine that uses this package and encountered this error:
Expected the HTML found at $('.DayPicker-Caption') to have no violations:
<div class="DayPicker-Caption" role="heading"><div>September 2019</div></div>
Received:
"Required ARIA attributes must be provided (aria-required-attr)"
Fix any of the following:
Required ARIA attribute not present: aria-level
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/3.3/aria-required-attr?application=axeAPI
I realize that this could a be a fault of axe-core
instead of react-day-picker
. The key issue is that while an element with role="heading"
should have an implicit aria-level
of 2, the outcome is not consistent and the attribute is marked as required. Even if aria-level=2
was intentional, it may not be correct depending on the context where the heading ends up.
Some useful discussion around the implementation of this rule is available here: https://github.com/dequelabs/axe-core/issues/814
I am not sure what the ideal fix would be. Maybe the heading
role is replaced with another technique or aria-level
is included?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (2 by maintainers)
I think another possible solution is similar to whats outlined here: https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html
Can use an aria-live attribute instead.
Closing as we’ve released v8: this issue belongs to a version which is not longer maintained, and it is likely fixed. In case, please open a new issue. Thanks!