{"record":{"id":"3a43bdf74e7adc54","repo":"oxc-project/oxc","slug":"elements-with-the-role-interactive-role-must-b","errorCode":null,"errorMessage":"Elements with the '{role}' interactive role must be tabbable.","messagePattern":"Elements with the '(.+?)' interactive role must be tabbable\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/jsx_a11y/interactive_supports_focus.rs","lineNumber":24,"sourceCode":"use schemars::JsonSchema;\nuse serde::Deserialize;\n\nuse crate::{\n    AstNode,\n    context::LintContext,\n    fixer::RuleFixer,\n    globals::HTML_TAG,\n    rule::{DefaultRuleConfig, Rule},\n    utils::{\n        KEYBOARD_EVENT_HANDLERS, MOUSE_EVENT_HANDLERS, get_element_type,\n        get_string_literal_prop_value, has_jsx_prop, has_jsx_prop_ignore_case, is_disabled_element,\n        is_hidden_from_screen_reader, is_interactive_element, is_interactive_role,\n        is_non_interactive_element, is_non_interactive_role, is_presentation_role,\n    },\n};\n\nfn must_be_tabbable_diagnostic(role: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Elements with the '{role}' interactive role must be tabbable.\"))\n        .with_help(\n            \"Add `tabIndex={0}` to make the element reachable via sequential keyboard navigation.\",\n        )\n        .with_label(span)\n}\n\nfn must_be_focusable_diagnostic(role: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Elements with the '{role}' interactive role must be focusable.\"))\n        .with_help(\"Add `tabIndex={0}` or `tabIndex={-1}` to make the element focusable.\")\n        .with_label(span)\n}\n\nconst EVENT_HANDLERS: &[&[&str]] = &[MOUSE_EVENT_HANDLERS, KEYBOARD_EVENT_HANDLERS];\n\nconst DEFAULT_TABBABLE: &[&str] =\n    &[\"button\", \"checkbox\", \"link\", \"searchbox\", \"spinbutton\", \"switch\", \"textbox\"];\n\n#[derive(Debug, Default, Clone, Deserialize)]","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/jsx_a11y/interactive_supports_focus.rs#L6-L42","documentation":"Raised by jsx-a11y/interactive-supports-focus when an element has an interactive ARIA role but is not tabbable (no tabIndex making it reachable by keyboard). Interactive elements must be focusable for keyboard users.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/jsx_a11y/interactive_supports_focus.rs:24 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add tabIndex={0} (or -1 with programmatic focus) to the element.","Prefer using a native interactive element (button, a) instead of a div with a role.","Avoid the role if the element is not actually interactive."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}