Skip to content

Listbox not closing when scrolling the page #3403

@r1chm8

Description

@r1chm8

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions