Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onHide is called every time the component is rendered #68

Closed
JesusTheHun opened this issue Jun 27, 2023 · 3 comments · Fixed by #77
Closed

onHide is called every time the component is rendered #68

JesusTheHun opened this issue Jun 27, 2023 · 3 comments · Fixed by #77
Labels
bug Something isn't working

Comments

@JesusTheHun
Copy link

Use Version

  • Headless UI: v1.7.5
  • Headless UI Float: v0.11.2
  • Framework: [e.g. vue v3.2.0, react v18.0]
  • @floating-ui/core: v1.0.0
  • @floating-ui/dom: v1.0.0
  • Browser : chrome, safari

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 JesusTheHun added the bug Something isn't working label Jun 27, 2023
@JesusTheHun
Copy link
Author

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

@senasi
Copy link

senasi commented Aug 30, 2023

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
Copy link
Owner

ycs77 commented Sep 2, 2023

Fixed on v0.11.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants