question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FloatingFocusManager does not honor outsidePointerDown from useDismiss

See original GitHub issue

In 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:closed
  • Created a year ago
  • Comments:20 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
atomikscommented, Jul 17, 2022

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.tsx

That said, I can add something like closeOnFocusOut: boolean if it’s really needed.

0reactions
mihkeleidastcommented, Jul 18, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found