ycs77 / headlessui-float

Easily use Headless UI with Floating UI to position floating elements.
https://headlessui-float.vercel.app
MIT License
342 stars 11 forks source link

Not closing menu when clicking outside #106

Closed blitzbohne closed 3 months ago

blitzbohne commented 3 months ago

Use Version Use version when bugs appear:

Describe the bug Using the exact code as sampled here https://headlessui-float.vercel.app/react/other-options.html to manually open close menus results in the menu no longer closing when clicking outside of it (one has to click the button so it toggles again). This is different to the original where you can use the internal open state to render via an (({open}) function. We need the open state to mark a button as active with menu open or not.

To Reproduce

It already happens with this exact sample: https://headlessui-float.vercel.app/react/other-options.html

Expected behavior

Should close the menu or provide a way to handle this properly as in original headless menu otherwise controlling the open / closed state manually is not usable due being unable to close the menu when clicking outside