`input role="switch"` fails on `aria-allowed-role`
See original GitHub issueProduct
axe Linter
Product Version
v4.4.2
Latest Version
- I have tested the issue with the latest version of the product
Issue Description
Expectation
<label>
<input
type="checkbox"
role="switch"
name="switch"
checked="checked"
aria-checked="false"
/>
Switch 1
</label>
should (I believe) be a valid aria configuration for a switch checkbox.
Actual
This code is flagged with
axe-linter (aria-allowed-role): Ensures role attribute has an appropriate value for the elementaxe-linter[dequeuniversity/aria-allowed-role](https://dequeuniversity.com/rules/axe/4.4/aria-allowed-role?application%3Daxe-linter)
How to Reproduce
demo.html:
<!DOCTYPE html>
<html lang="en-US">
<body>
<label>
<input
type="checkbox"
role="switch"
name="switch"
checked="checked"
aria-checked="false"
/>
Switch 1
</label>
</body>
</html>
Additional context
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
`input role="switch"` fails on `aria-allowed-role` · dequelabs ... - GitHub
`input role="switch"` fails on `aria-allowed-role` · Run details · Usage · Workflow file.
Read more >ARIA: switch role - Accessibility - MDN Web Docs - Mozilla
The ARIA switch role is functionally identical to the checkbox role, except that instead of representing "checked" and "unchecked" states, ...
Read more >ARIA in HTML - W3C
Allow combobox and checkbox roles on input type=button element. ... Authors MAY use the ARIA role and aria-* attributes to change the ...
Read more >Elements must only use allowed ARIA attributes
Using ARIA attributes in roles where they are not permitted can impair web page accessibility. Using an improper role-attribute combination will have no ......
Read more >aria-allowed-role - Accessibility Insights
When an assistive technology encounters an invalid role, it will not be able to communicate the elements features, properties, and methods to its...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just a heads up on this ticket. This should be fixed in the next release of axe-linter, which should be happening in the next few weeks.
Confirmed this is a bug. Thanks for letting us know.