Skip to content

jsx_a11y/no-access-key Correctness

What it does

Enforces that the accessKey prop is not used on any element to avoid complications with keyboard commands used by a screenreader.

Why is this bad?

Access keys are HTML attributes that allow web developers to assign keyboard shortcuts to elements. Inconsistencies between keyboard shortcuts and keyboard commands used by screenreaders and keyboard-only users create accessibility complications so to avoid complications, access keys should not be used.

Example

Examples of incorrect code for this rule:

jsx
<div accessKey="h" />

Examples of correct code for this rule:

jsx
<div />

References

Released under the MIT License.