Skip to content

Commit d48d268

Browse files
committed
test(template-no-role-presentation-on-focusable): clarify spec rationale for flagging tabindex=-1 + presentation
1 parent b6c8b70 commit d48d268

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

tests/lib/rules/template-no-role-presentation-on-focusable.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,12 @@ ruleTester.run('template-no-role-presentation-on-focusable', rule, {
9797
output: null,
9898
errors: [{ messageId: 'invalidPresentation' }],
9999
},
100-
// tabindex="-1" on an inherently-focusable element still accepts programmatic
101-
// focus (focus() works; the element stays in the a11y tree). Rule flags it.
102-
// vuejs-accessibility treats tabindex="-1" as "removed from tab order = not focusable" — we disagree.
100+
// tabindex="-1" makes an element a programmatic focus target per HTML §6.6.3
101+
// ("focusable but not sequentially focusable") — focus() works and the
102+
// element remains in the a11y tree, so WAI-ARIA's Presentational Roles
103+
// Conflict Resolution kicks in and the UA exposes the implicit role anyway.
104+
// Rule flags the author-side anti-pattern. jsx-a11y / vue-a11y exempt
105+
// tabindex="-1"; we follow the spec.
103106
{
104107
code: '<template><button tabindex="-1" role="presentation">Press</button></template>',
105108
output: null,

0 commit comments

Comments
 (0)