Skip to content

feat(keyboard): ngbr/drag-without-keyboard; dialog focus traps for Material, PrimeNG, ngx-bootstrap, ng-bootstrap (0.17.0) - #43

Merged
DuncanFaulkner merged 10 commits into
mainfrom
fix/mat-dialog-trap
Oct 9, 2026
Merged

DuncanFaulkner merged 10 commits into
mainfrom
fix/mat-dialog-trap

Conversation

@DuncanFaulkner

Copy link
Copy Markdown
Contributor

Release 0.17.0.

Fixed

  • The tab-order layer showed the page's tab stops under an open Angular Material dialog. Material 22 opens mat-dialog with aria-modal="false", and the trap check only looked at aria-modal="true". It now finds the CDK anchors around any dialog role or CDK dialog container. Report mode no longer counts Tab cycling inside a default mat-dialog as ngbr/focus-trap. New real-browser E2E opens a real @angular/cdk Dialog (3 tab stops shown before, 2 now).
  • PrimeNG and ngx-bootstrap keep their sentinels inside the dialog; ng-bootstrap's modal and offcanvas trap focus with a script. All three are recognised now, so no stray page stops and no false ngbr/modal-focus-not-contained.

Added

  • ngbr/drag-without-keyboard (WCAG 2.1.1, 2.5.7): a CDK drop list, or two or more draggable="true" siblings, with no keyboard way to move the items. Checked live on the examples admin board (5 CDK lists, 0 findings) and with an injected mouse-only list (serious).

devDependencies: @angular/cdk and @angular/forms 22.2.1 for the E2E fixture. Docs: ngbracket/market-place#189.

🤖 Generated with Claude Code

DuncanFaulkner and others added 10 commits October 9, 2026 21:58
…(0.16.1)

Material 22 opens mat-dialog with aria-modal="false". The trap check only
looked at aria-modal="true", so the tab-order layer numbered the page's stops
under an open dialog. Look for the CDK anchors around any dialog role or CDK
dialog container; report mode treats a cycle inside a CDK dialog container as
contained.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lector private)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…focus traps

PrimeNG's pFocusTrap and ngx-bootstrap's modal-container keep their sentinels
inside the dialog; ng-bootstrap traps Tab with a script and no sentinels. The
tab-order layer drew the page's stops under these dialogs, and
modal-focus-not-contained reported a leak that isn't there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reports a drag-and-drop list (CDK cdk-drag in a cdk-drop-list, or
draggable="true") with no keyboard way to move its items: no move control
near the list, and no reachable drag handle that handles keys. Maps to WCAG
2.1.1 and 2.5.7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(roving boards)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Native draggable needs two or more items and is moderate; move names match
verbs, arrows and whole-name Up/Down only; key search runs up to the
component host; nested drop lists group under the outer list; count wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…b stops

Adds @angular/cdk and @angular/forms (its peer) as devDependencies for the E2E
fixture. With main's trap detection the layer showed 3 stops (the page button
behind the dialog too); now 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…de it

Found on the a11y-demo page: two lists in one section, and the second list's
buttons silenced the first. Move controls now count in the list or in a
sibling that holds no other drag list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tabindex="-1" handles count as reachable only when a drag list on the page
has a tab stop; native draggables inside a CDK item are skipped; key search
wording and condition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DuncanFaulkner
DuncanFaulkner merged commit 90a3635 into main Oct 9, 2026
1 check passed
@DuncanFaulkner
DuncanFaulkner deleted the fix/mat-dialog-trap branch October 9, 2026 21:35
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