Skip to content

fix(keyboard): don't report Material checkbox/radio touch targets as unreachable (0.18.1) - #45

Merged
DuncanFaulkner merged 4 commits into
mainfrom
fix/touch-target-false-positive
Oct 14, 2026
Merged

DuncanFaulkner merged 4 commits into
mainfrom
fix/touch-target-false-positive

Conversation

@DuncanFaulkner

Copy link
Copy Markdown
Contributor

Angular Material 15–21 render an empty .mat-mdc-checkbox-touch-target / .mat-mdc-radio-touch-target div with a click handler beside the native input. ngbr/unreachable-control (and the hover check) reported it as a clickable you can't reach by keyboard. The input itself is a normal tab stop, so this was always a false positive.

The keyboard scan now skips an empty, role-less clickable whose parent holds an input[type=checkbox] or input[type=radio]. It doesn't require aria-hidden, since Material 15–20 don't set it. Other native controls aren't covered, so a CSS clear-× next to a text input is still reported.

  • Tests: 428/428
  • CHANGELOG 0.18.1, version bump

…ts as unreachable

Angular Material 15 to 21 puts an empty, aria-hidden touch target with a
click handler beside the native input in every checkbox and radio button.
Tab reaches the input, but ngbr/unreachable-control reported the touch
target. Skip an empty aria-hidden element with a click listener whose
parent holds a native control. Release 0.18.1.
Review: beside a text field or a button, an empty aria-hidden clickable is
usually a separate action (a CSS-drawn clear button), so it stays reported.
Skipped hit areas are also kept out of the hover check.
… there)

Only Material 21 marks the checkbox/radio touch target aria-hidden; 15 to
20 render the same empty element and click handler without it. Being empty,
role-less and beside a checkbox or radio input is enough.
@DuncanFaulkner
DuncanFaulkner merged commit 499fcab into main Oct 14, 2026
1 check passed
@DuncanFaulkner
DuncanFaulkner deleted the fix/touch-target-false-positive branch October 14, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant