--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: reactCreateElementInvalid.js --- # Input ```jsx React.createElement("div", { tabIndex: '1' }) React.createElement("div", { tabIndex: 1 }) React.createElement("div", { tabIndex: +1 }) React.createElement("div", { tabIndex: +0o1 }) ``` # Diagnostics ``` reactCreateElementInvalid.js:1:40 lint/a11y/noPositiveTabindex FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid positive values for the tabIndex prop. > 1 │ React.createElement("div", { tabIndex: '1' }) │ ^^^ 2 │ React.createElement("div", { tabIndex: 1 }) 3 │ React.createElement("div", { tabIndex: +1 }) i Elements with a positive tabIndex override natural page content order. This causes elements without a positive tab index to come last when navigating using a keyboard. i Use only 0 and -1 as tabIndex values. Avoid using tabIndex values greater than 0 and CSS properties that can change the order of focusable HTML elements. i Unsafe fix: Replace the tableIndex prop value with 0. 1 │ - React.createElement("div",·{·tabIndex:·'1'·}) 1 │ + React.createElement("div",·{·tabIndex:·"0"·}) 2 2 │ React.createElement("div", { tabIndex: 1 }) 3 3 │ React.createElement("div", { tabIndex: +1 }) ``` ``` reactCreateElementInvalid.js:2:40 lint/a11y/noPositiveTabindex FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid positive values for the tabIndex prop. 1 │ React.createElement("div", { tabIndex: '1' }) > 2 │ React.createElement("div", { tabIndex: 1 }) │ ^ 3 │ React.createElement("div", { tabIndex: +1 }) 4 │ React.createElement("div", { tabIndex: +0o1 }) i Elements with a positive tabIndex override natural page content order. This causes elements without a positive tab index to come last when navigating using a keyboard. i Use only 0 and -1 as tabIndex values. Avoid using tabIndex values greater than 0 and CSS properties that can change the order of focusable HTML elements. i Unsafe fix: Replace the tableIndex prop value with 0. 1 1 │ React.createElement("div", { tabIndex: '1' }) 2 │ - React.createElement("div",·{·tabIndex:·1·}) 2 │ + React.createElement("div",·{·tabIndex:·"0"·}) 3 3 │ React.createElement("div", { tabIndex: +1 }) 4 4 │ React.createElement("div", { tabIndex: +0o1 }) ``` ``` reactCreateElementInvalid.js:3:40 lint/a11y/noPositiveTabindex FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid positive values for the tabIndex prop. 1 │ React.createElement("div", { tabIndex: '1' }) 2 │ React.createElement("div", { tabIndex: 1 }) > 3 │ React.createElement("div", { tabIndex: +1 }) │ ^^ 4 │ React.createElement("div", { tabIndex: +0o1 }) 5 │ i Elements with a positive tabIndex override natural page content order. This causes elements without a positive tab index to come last when navigating using a keyboard. i Use only 0 and -1 as tabIndex values. Avoid using tabIndex values greater than 0 and CSS properties that can change the order of focusable HTML elements. i Unsafe fix: Replace the tableIndex prop value with 0. 1 1 │ React.createElement("div", { tabIndex: '1' }) 2 2 │ React.createElement("div", { tabIndex: 1 }) 3 │ - React.createElement("div",·{·tabIndex:·+1·}) 3 │ + React.createElement("div",·{·tabIndex:·"0"·}) 4 4 │ React.createElement("div", { tabIndex: +0o1 }) 5 5 │ ```