Closed
Description
Describe the bug
AnchoredOverlay
currently only activates the internal focus trap if the user interacts with the anchor element in specific ways. New uses of the AnchoredOverlay
include behaviors where a user can click inside the overlay multiple times, which removes focus from the anchor without activating the focus trap. In these scenarios, the user is able to tab to other parts of the DOM without restriction. We should handle this scenario and activate the focus trap if the anchor loses focus in some unexpected way.
To Reproduce
Steps to reproduce the behavior:
- Go to https://primer.style/components/DropdownMenu
- Open the menu in the example
- Click on the edge of the menu (small margin on left or right side, but not in an item)
- Note that focus has left the anchor button. You can now press
Tab
to focus on other parts of the page
Expected behavior
If focus leaves the anchor without the overlay closing, focus trap should activate immediately
Metadata
Metadata
Assignees
Labels
No labels