chore(site): enable interactive-supports-focus oxlint rule (#31148)
Moves [interactive-supports-focus](https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/interactive-supports-focus.html#what-it-does) out of the Oxlint migration backlog and sets it to `error`. I've ignored the single violation (DateTimeRangePicker.tsx) with an `oxlint-disable` comment backed up by [MDN's guidelines on required keyboard actions for role="radiogroup" elements](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/radiogroup_role#tab): >[<kbd>Tab</kbd> and <kbd>Shift + Tab</kbd>](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/radiogroup_role#tab) > > Move focus into and out of the `radiogroup`. When focus moves into a `radiogroup`, if a radio button is checked, focus is set on the checked button. If none of the radio buttons are checked, focus is set on the first radio button in the group. Adding `tabIndex` on that radio group per `interactive-supports-focus` would add an unnecessary extra tab stop before a user is able to select date range picker options. Verified with: - `pnpm oxlint --deny-warnings` - `pnpm biome lint --error-on-warnings` - `pnpm tsc -p .`
This commit is contained in:
1 parent
b911ed9782
commit
8486b50d80
2 files changed
+2
-2
No files matched your search
@@ -33,6 +33,7 @@
|
||||
"media-has-caption": "error",
|
||||
"click-events-have-key-events": "error",
|
||||
"no-noninteractive-tabindex": "error",
|
||||
"interactive-supports-focus": "error",
|
||||
"iframe-has-title": "error",
|
||||
|
||||
// --- complexity ---
|
||||
@@ -226,8 +227,6 @@
|
||||
// Effort = approximate work before enabling:
|
||||
// small < medium < large < xl.
|
||||
// ==========================================================
|
||||
"interactive-supports-focus": "off", // a11y/useFocusableInteractive (small)
|
||||
|
||||
// Correctness category rules with existing violations.
|
||||
"require-mock-type-parameters": "off", // (xl)
|
||||
"prefer-tag-over-role": "off", // (large)
|
||||
|
||||
@@ -324,6 +324,7 @@ export const DateTimeRangePicker: React.FC<DateTimeRangePickerProps> = ({
|
||||
<div className="flex">
|
||||
{/* Quick picks. This list is the entire dropdown until the
|
||||
user expands the custom range panel. */}
|
||||
{/* oxlint-disable-next-line jsx-a11y/interactive-supports-focus -- tabIndex must be omitted here; focus order should jump directly from the popover trigger to the role="radio" children, matching the behavior of a <select> element */}
|
||||
<div
|
||||
role="radiogroup"
|
||||
aria-label="Quick ranges"
|
||||
|
||||
Reference in new issue
Block a user