Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 967 Bytes

aria-role.md

File metadata and controls

43 lines (33 loc) · 967 Bytes

aria-role

Elements with ARIA roles must use a valid, non-abstract ARIA role.

References:

  1. WAI-ARIA site.
  2. AX_ARIA_01
  3. DPUB-ARIA roles

Rule details

This rule takes one optional object argument of type object:

{
  "rules": {
    "vuejs-accessibility/aria-role": ["error", { "ignoreNonDOM": true }]
  }
}

Succeed

<div role="button" />
<!-- Good: "button" is a valid ARIA role -->
<div :role="role" />
<!-- Good: role is a variable & cannot be determined until runtime. -->
<div />
<!-- Good: No ARIA role -->
<Foo role="test" />
<!-- Good: ignoreNonDOM is set to true -->

Fail

<div role="datepicker" />
<!-- Bad: "datepicker" is not an ARIA role -->
<div role="range" />
<!-- Bad: "range" is an _abstract_ ARIA role -->