ycs77 / headlessui-float

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

`onHide` is called every time the component is rendered #68

Closed JesusTheHun closed 10 months ago

JesusTheHun commented 1 year ago

Use Version

Describe the bug The onHide callback is called every time the component is rendered instead of when the dropdown is closed.

To Reproduce https://stackblitz.com/edit/github-tvfv3k?file=src%2Fpages%2Fcombobox.tsx

  1. Open your browser's console
  2. Go to the Floating Combobox
  3. Type something in the input
  4. See the logs in the console, showing the calback has been called several time

Expected behavior onHide should be only called when the dropdown is closed

JesusTheHun commented 1 year ago

After some investigations, v0.10.1 was working properly. The bug has been introduced by v0.11.0

senasi commented 10 months ago

This is also true for onShow handler, which is called on each render. Even if you set show={true} directly to Float component, the handler will be called every time.

ycs77 commented 10 months ago

Fixed on v0.11.3