Closed
Description
Bug report
Current Behavior
Dialog resets focus to first focusable element when browser tab is blurred.
Expected behavior
Focus should be retained when leaving browser window/tab and returning to it.
Reproducible example
Suggested solution
This might be because of trapFocus
re-initializing on document focus, but I'm not 100% sure:
https://github.com/radix-ui/primitives/blob/main/packages/react/focus-scope/src/createFocusScope.tsx#L30
Your environment
Software | Name(s) | Version |
---|---|---|
Radix Package(s) | Dialog | 0.06 |
React | 17.0.1 | |
Browser | Chrome | 88.0 |
Assistive tech | n/a | |
Node | n/a | |
npm/yarn | n/a | |
Operating System | MacOs | 10.15.6 |
Reproducible pretty much everywhere except Safari (13.1.2).
Metadata
Metadata
Assignees
Labels
No labels