Commit 92f3213
committed
fix: template-no-invalid-interactive — honor role=presentation/none and aria-hidden as escape hatches
Premise: peer a11y plugins (jsx-a11y `hasPresentationRole` + aria-hidden
handling inside `isInteractiveElement`; vuejs-accessibility's equivalent)
treat `role="presentation"` / `role="none"` and `aria-hidden`
(boolean / "true" / `{{true}}`) as explicit opt-outs of the interactivity
contract. An element that has opted out via ARIA does not need an
interactive handler check — the handler is authored acknowledging the
element is decorative or hidden from AT.
Conclusion: wire that opt-out into `template-no-invalid-interactive`
before the native/role-based interactivity probe runs.
- Adds `hasNonInteractiveEscapeHatch(node)` covering:
- `role="presentation"` / `role="none"` (case-insensitive, trimmed,
first token of a space-separated role list — matches jsx-a11y).
- `aria-hidden` as bare boolean attribute, the text value `"true"`,
or the mustache-literal `{{true}}`. `aria-hidden="false"` does NOT
qualify.
- Visitor short-circuits on escape-hatch hit before computing interactivity.
- Tests: new valid cases for every escape-hatch shape; new invalid
cases guarding that `aria-hidden="false"` and other roles still flag.
- Audit fixture `tests/audit/no-static-element-interactions/peer-parity.js`
added to master as evidence of parity. D1 (role=presentation/none) and
D2 (aria-hidden) divergences previously documented in the Phase-3 audit
branch are now parity cases in the valid block.
Tracks PR #28 item G1 (escape-hatch awareness across interactive-handler
rules).1 parent 414d6d5 commit 92f3213
3 files changed
Lines changed: 626 additions & 11 deletions
File tree
- lib/rules
- tests
- audit/no-static-element-interactions
- lib/rules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | | - | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
19 | 69 | | |
20 | 70 | | |
21 | 71 | | |
| |||
143 | 193 | | |
144 | 194 | | |
145 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
146 | 205 | | |
147 | 206 | | |
148 | 207 | | |
| |||
0 commit comments