Skip to content

Commit 3ce40eb

Browse files
committed
fix(#19): drop details/option/datalist from focusable set (Copilot review)
Per HTML §6.6.3 'Sequential focus navigation', none of <details>, <option>, or <datalist> are focusable by default: - <details>: the focusable control is its <summary> child - <option>: not in default tab order; <select> is focused and arrow keys navigate options within it - <datalist>: no user-facing UI; the paired <input list> is focused Including them in UNCONDITIONAL_FOCUSABLE_TAGS was over-aggressive and caused false positives on this rule. Tests updated to pin the now-allowed cases.
1 parent 6e45e37 commit 3ce40eb

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/rules/template-no-aria-hidden-on-focusable.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,19 @@ function isAriaHiddenTrue(node) {
4444
// focusable by default — clicks on a label forward to its associated control,
4545
// but the label itself isn't in the tab order. So it's excluded here even
4646
// though `isHtmlInteractiveContent` would return true for it.
47+
// Per HTML §6.6.3 "Sequential focus navigation", tags in the default tab
48+
// order without further qualification. Explicitly excluded:
49+
// - <details>: the focusable control is its <summary> child, not details.
50+
// - <option>: not in the default focus order; <select> is focused and
51+
// arrow keys navigate options within it (not Tab).
52+
// - <datalist>: no user-facing UI; the paired <input list> is focused.
4753
const UNCONDITIONAL_FOCUSABLE_TAGS = new Set([
4854
'button',
4955
'select',
5056
'textarea',
5157
'iframe',
5258
'embed',
5359
'summary',
54-
'details',
55-
'option',
56-
'datalist',
5760
]);
5861

5962
// Form-control tags whose `disabled` attribute removes them from the tab order

0 commit comments

Comments
 (0)