[combobox][popover] Add visually hidden close button support with improved modal focus trapping#4084
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
53a0448 to
82fa23c
Compare
82fa23c to
17cf66c
Compare
Codex ReviewOverviewThis patch improves trapped popup accessibility in two places. Popovers only enable trapped modal behavior when a Findings (None)No blocking issues found in this patch. Confidence: 4/5High confidence from a full branch pass and focused verification of the updated combobox, popover, and focus-manager paths with Notes
|
|
I found an issue when testing it with VoiceOver on an iPad: after I go through the whole list of items and arrive at the hidden close button, VoiceOver focus moves to the input right after the close button is announced. This happens just once per open combobox (focusing the close button again works as expected). |
56e0312 to
1d2f2c3
Compare
1d2f2c3 to
5bcd56f
Compare
e533fd7 to
b4dd0fe
Compare
606e8e7 to
eff61d6
Compare
9d24107 to
d825ad5
Compare
Improves modal popup accessibility by ensuring there is a reachable escape hatch for the flows that trap assistive-technology focus.
Closes #2722
Closes #3693
Closes #4096
Changes in this PR:
Popovernow traps focus whenmodalis enabled and aPopover.Closeis rendered insidePopover.PopupComboboxandAutocompletenow render an internal dismiss button after the popup whenever the popup is modal to assistive technologyFloatingFocusManager, even though it is rendered outside the popup elementFloatingFocusManagerno longer inserts the hidden fallback span after the reference elementfinalFocusremains the preferred way to restore focus when the trigger itself gets removed.