Rule: {{actions}} on non-interactive elements must have a role attribute
See original GitHub issueBad:
<div {{action "toggleModal"}}>Open the modal</div>
<span {{action "toggleModal"}}>Open the modal</span>
Good:
<div {{action "toggleModal"}} role="button">Open the modal</div>
<span {{action "toggleModal"}} role="button">Open the modal</span>
Bestest:
<button {{action "toggleModal"}}>Open the modal</button>
<button {{action "toggleModal"}}>Open the modal</button>
Anytime you’re adding an interaction (an action) to a non-interaction HTML element you must specify an aria role. For this example you’d use the button role. This is so assistive technology can understand the element can be interacted with.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:11 (8 by maintainers)
Top Results From Across the Web
Using ARIA
2.5 Fifth Rule of ARIA Use. All interactive elements must have an accessible name. An interactive element only has an accessible name when...
Read more >ARIA: button role - Accessibility - MDN Web Docs
The button role is for clickable elements that trigger a response when activated by the user. Adding role="button" tells the screen reader ...
Read more >Best Practices For Using ARIA Roles, States, And Properties
All interactive elements must have an accessible name. First Rule of ARIA Use. If you can use a native HTML element or attribute...
Read more >How Not To Use Aria
ARIA attributes can be misused, and this often leads to all sorts of problems for ... Rule 5, all interactive elements must have...
Read more >Ensure elements marked as presentational are consistently ...
Checks every element with role=“none” or role=“presentation” to ensure they do not have a global ARIA attribute and are not focusable. Learn more:...
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 wanted to chime in and mention that I did a bit of work on extracting the ability to detect interactive elements from the nested-interactive rule this weekend (in https://github.com/rwjblue/ember-template-lint/pull/49 and https://github.com/rwjblue/ember-template-lint/pull/50). I’d like to land this rule (along with the one suggested in #45) on the 19th (for http://www.globalaccessibilityawarenessday.org/)…
Released in v0.5.12. We cannot add this rule to the default recommended list until the next major version, but I do intend to add to
recommended
once we release0.6.0
.