FloatingFocusManager does not honor outsidePointerDown from useDismiss
See original GitHub issueIn some scenarios I’d like to not close my popover on outside click, but would still like to use FloatingFocusManager for other focus handling. It seemed like disabling outsidePointerDown
in useDismiss should work for this as well, but no such luck - looks like the focusout event fires on outside click as well.
Sandbox: (forked from the official non-modal dialog example) https://codesandbox.io/s/laughing-resonance-n8xxnn?file=/src/Popover.tsx:1028-1046
Issue Analytics
- State:
- Created a year ago
- Comments:20 (10 by maintainers)
Top Results From Across the Web
FloatingFocusManager - Floating UI
Provides flexible modal or non-modal focus management for a floating element. Modal behavior is the default — focus is fully trapped inside the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Btw your example can be fixed by using
FloatingTree
. It will know the tooltip is a child of the popover even though it’s portalled outside of it: https://codesandbox.io/s/happy-brahmagupta-si6nen?file=/src/Popover.tsxThat said, I can add something like
closeOnFocusOut: boolean
if it’s really needed.Oh, interesting. That’s probably because while the Button is awaiting the promise, it is disabled, that loses focus. Alright, that is understandable, I think then the correct move for this specific issue is to disallow the async onClick prop on DropdownButton (or maybe use aria-disabled instead of disabled on the Button for loading state).
Cheers, thanks for all the help! I think there isn’t anything left to investigate here, I’ll close this issue out.