floating-ui / react-popper

🍿⚛Official React library to use Popper, the positioning library
https://popper.js.org/react-popper/
MIT License
2.5k stars 226 forks source link

Feature: Close on click outside Boolean property #449

Closed hichemfantar closed 1 year ago

hichemfantar commented 1 year ago

A property to specify whether the dropdown should close on click outside or not would be very useful.

viktoryoo commented 1 year ago

Agree. It took me some time to implement a custom hook to inspect a mouse event when is clicked outside of the poper to close it...

atomiks commented 1 year ago

react-popper (and @floating-ui/react-dom) only handles positioning

Use Floating UI Interactions to handle all types of interactions, including outside clicks