{"record":{"id":"10b16429617aeb3a","repo":"oxc-project/oxc","slug":"elements-with-the-role-interactive-role-must-b-10b164","errorCode":null,"errorMessage":"Elements with the '{role}' interactive role must be focusable.","messagePattern":"Elements with the '(.+?)' interactive role must be focusable\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/jsx_a11y/interactive_supports_focus.rs","lineNumber":32,"sourceCode":"    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)]\npub struct InteractiveSupportsFocus(Box<InteractiveSupportsFocusConfig>);\n\n#[derive(Debug, Clone, JsonSchema, Deserialize)]\n#[serde(rename_all = \"camelCase\", default, deny_unknown_fields)]\npub struct InteractiveSupportsFocusConfig {\n    /// An array of interactive ARIA roles that should be considered tabbable (require `tabIndex={0}`).\n    /// Interactive roles not in this list are only required to be focusable (`tabIndex={-1}` is sufficient).\n    /// Defaults to `[\"button\", \"checkbox\", \"link\", \"searchbox\", \"spinbutton\", \"switch\", \"textbox\"]`.","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/jsx_a11y/interactive_supports_focus.rs#L14-L50","documentation":"Variant of the jsx-a11y/interactive-supports-focus diagnostic for the 'always' configuration, firing when an element with an interactive role is not focusable, regardless of event handlers. The element must be reachable via keyboard focus.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/jsx_a11y/interactive_supports_focus.rs:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add tabIndex to make the element focusable.","Replace the role-bearing element with a native focusable element such as button or a.","Disable the rule if the element is focusable through other means (e.g. roving tabindex managed elsewhere)."],"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"}