tailwindlabs / headlessui

Completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.
https://headlessui.com
MIT License
25.81k stars 1.07k forks source link

Dropdown Menu hides scrollbar and disables scrolling on open #3222

Closed Laurentvw closed 4 months ago

Laurentvw commented 4 months ago

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

v2.0.3

What browser are you using?

Chrome

Reproduction URL

https://codesandbox.io/p/devbox/elastic-hill-glg8vk?file=%2Fsrc%2FApp.jsx%3A60%2C1

Describe your issue

The issue occurs with the Dropdown Menu, with this particular layout structure that I am using. When the Menu is clicked, it hides the browser scrollbar and also does not let me scroll down anymore while the menu is open.

The issue was not present when previously using v2.0.0-alpha.4.

https://github.com/tailwindlabs/headlessui/assets/50680/7298b7ef-dc31-4e9b-a5be-d192df0468c2

Laurentvw commented 4 months ago

Figured it out. MenuItems need modal prop to be set to false.

DevelopJKong commented 3 months ago

@Laurentvw thank you so much!