jsx-a11y/tabindex-no-positive
Disallow positive tabIndex values, which override the natural tab order and make focus jump unpredictably.
- Category: Accessibility
- Severity: warn
- Source:
oxlint-builtin:jsx-a11y - Framework: global
- Enabled when: always (unless customRulesOnly=true)
- Documentation: https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/tabindex-no-positive
Validate the diagnostic
Confirm the reported code matches this rule before you edit it.
Fires when a tabIndex prop is a positive integer (1, 2, 3, ...) as a literal or string — tabIndex={0} (focusable in DOM order) and tabIndex={-1} (programmatically focusable only) are allowed. Positive values override the natural tab order and cause focus to jump unpredictably. False positive: an intentional full-document tabindex map for a complex form — but even then, reordering DOM is preferred.
How to fix
Follow the rule guidance while preserving unrelated behavior.
Copyable fix prompt
Copy this self-contained prompt into your coding agent after you confirm the diagnostic.
Related rules
More Accessibility rules from the rules reference:
react-doctor/alt-text: Require alternative text on img, area, input[type='image'], and object elements so screen readers can describe them.react-doctor/anchor-ambiguous-text: Describe a link's destination — avoid bare 'click here' / 'learn more' / 'link' as the only link text.react-doctor/anchor-has-content: Add visible or aria-labelled text inside every `<a>`.react-doctor/anchor-is-valid: Require anchors to navigate to a real destination — use a button for click-only actions instead of href='#' or javascript:void(0).react-doctor/aria-activedescendant-has-tabindex: Add `tabIndex` to elements with `aria-activedescendant` so they're keyboard-focusable.