question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rule: {{actions}} on non-interactive elements must have a role attribute

See original GitHub issue

Bad:

<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:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
rwjbluecommented, May 15, 2016

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/)…

0reactions
rwjbluecommented, Jun 4, 2016

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 release 0.6.0.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found