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

Listbox not closing when scrolling the page #3403

Closed
r1chm8 opened this issue Jul 30, 2024 · 2 comments · Fixed by #3407
Closed

Listbox not closing when scrolling the page #3403

r1chm8 opened this issue Jul 30, 2024 · 2 comments · Fixed by #3407
Assignees

Comments

@r1chm8
Copy link

r1chm8 commented Jul 30, 2024

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

For example: v2.1.2

What browser are you using?

Chrome

Reproduction URL

https://codesandbox.io/p/sandbox/nameless-snow-kxmc7z

Describe your issue

  • Have two listbox components on the same page with the modal={false} prop
  • Open one of the listboxes
  • Scroll the page to a different position from where you opened the first listbox
  • Click on the second listbox button
  • Second listbox opens
  • The problem is the first listbox also remains open

Expected behaviour is for the first listbox to close when opening the second one. The expect behaviour happens if you do not scroll the page, scrolling seems to be causing the issue.

bug-vid.mov
@RobinMalfait
Copy link
Member

Hey! This should be fixed by #3407, and will be available in the next release.

You can already try it using:

  • npm install @headlessui/react@insiders.

@r1chm8
Copy link
Author

r1chm8 commented Aug 5, 2024

Looks good, thank you for sorting out this bug so quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants