fix: add focus trap, keyboard handling, and aria-modal to PolicyConflictDialog (Closes #297) - #374
Merged
Lakes41 merged 1 commit intoJul 29, 2026
Conversation
…ictDialog Adds accessible modal dialog behavior: - aria-modal="true" attribute on the dialog container - Focus trap using the existing useFocusTrap hook (Tab/Shift+Tab wrapping) - Escape key handler that calls onCancel - Auto-focus on mount and focus restoration on close - Focus is trapped within the dialog while open Closes Adamantine-guild#297
waterWang
force-pushed
the
fix/policy-conflict-focus-trap
branch
from
July 29, 2026 11:58
cb907d9 to
b8d65b8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the accessibility issues in
PolicyConflictDialogas described in #297.Changes
Component (components/ui/policy-conflict-dialog.tsx)
aria-modal="true"to the dialog containerrefonto the dialog container for focus trap targetinguseFocusTraphook fromlib/hooks/use-focus-trap.ts:Tab/Shift+Tabcannot move focus to elements outside the dialog while it's openEscapecallsonCanceland closes the dialogTests
All 10 existing tests in
test/policy-conflict-dialog-a11y.test.tsxpass, including thearia-modal="true"assertion.Acceptance Criteria
aria-modal="true"is presentnpm testCloses #297