Skip to main content

a11y/noAccessKey

MISSING DOCUMENTATION

Examples

Invalid

<input accessKey="key" />

 file.tsx:1:7 lint/a11y/noAccessKey  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Avoid the accessKey attribute to reduce inconsistencies between
    keyboard shortcuts and screen reader keyboard comments.

    <input accessKey="key" />
           ^^^^^^^^^^^^^^^

  Assigning keyboard shortcuts using the accessKey attribute leads to
    inconsistent keyboard actions across applications.

  Safe fix

  - <input·accessKey="key"·/>
  + <input·/>


<input accessKey={key} />

 file.tsx:1:7 lint/a11y/noAccessKey  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Avoid the accessKey attribute to reduce inconsistencies between
    keyboard shortcuts and screen reader keyboard comments.

    <input accessKey={key} />
           ^^^^^^^^^^^^^^^

  Assigning keyboard shortcuts using the accessKey attribute leads to
    inconsistent keyboard actions across applications.

  Safe fix

  - <input·accessKey={key}·/>
  + <input·/>

<input accesskey="key" />

 file.html:1:7 lint/a11y/noAccessKey  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Avoid the accessKey attribute to reduce inconsistencies between
    keyboard shortcuts and screen reader keyboard comments.

    <input accesskey="key" />
           ^^^^^^^^^^^^^^^

  Assigning keyboard shortcuts using the accessKey attribute leads to
    inconsistent keyboard actions across applications.

  Safe fix

  - <input·accesskey="key"·/>
  + <input·/>

Valid

<input />
<input accessKey={undefined} />
<Input accessKey={key} />
<input />