Skip to content

tabIndexPositiveValues

Reports positive tabIndex values.

✅ This rule is included in the jsx logical preset.

Positive tabIndex values disrupt the natural tab order and make keyboard navigation unpredictable for users. Instead, use tabIndex="0" to include elements in the natural tab order, or tabIndex="-1" to make them programmatically focusable.

This is required for WCAG 2.4.3 compliance.

<span tabIndex="5">content</span>
<span tabIndex="1">content</span>
<div tabIndex={3}>content</div>

If you are managing tab orders with a well-defined focus management system that handles positive tabIndex values well, this rule may not be applicable.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.