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

bug: scroll not working if I scroll over overlay in dialog #1132

Closed
ashwinkhode opened this issue Feb 22, 2022 · 2 comments · Fixed by #1333
Closed

bug: scroll not working if I scroll over overlay in dialog #1132

ashwinkhode opened this issue Feb 22, 2022 · 2 comments · Fixed by #1333
Assignees

Comments

@ashwinkhode
Copy link

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

v1.5.0

What browser are you using?

Chrome

Reproduction URL

https://utc3i4.csb.app/

Describe your issue

I am not able to scroll modal if I scroll over the overlay. I can only scroll modal if I scroll over the modal content. Let me know if I can provide some more info if needed

Current Behavior - When I scroll over overlay of the modal, modal content is not scrolling
Expected Behavior - When I scroll over overlay of the modal or anywhere over the screen if the modal is open, then the modal should scroll even if I scroll outside modal content

Screenshot
image

@RobinMalfait RobinMalfait self-assigned this Feb 22, 2022
@ashwinkhode ashwinkhode changed the title scroll not working if I scroll over overlay in dialog bug: scroll not working if I scroll over overlay in dialog Feb 22, 2022
@RobinMalfait
Copy link
Member

Hey! Thank you for your bug report!
Much appreciated! 🙏

This is a known issue and we will work on it soon but have to figure a few things out first. Going to close it as a duplicate of #1056

@RobinMalfait
Copy link
Member

Hey! Thank you for your bug report!
Much appreciated! 🙏

This should be fixed by #1333, and will be available in the next release.

You can already try it using npm install @headlessui/react@insiders or yarn add @headlessui/react@insiders.

However, in order to make it work properly, you have to update the Dialog.Overlay with Dialog.Backdrop. In addition, you have to mark your panel with your contents by wrapping it in a Dialog.Panel. In your case I swapped the div out with a Dialog.Panel.

Here is an updated CodeSandbox that includes the insiders build: https://codesandbox.io/s/holy-leaf-wkf4pv?file=/src/App.js

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

Successfully merging a pull request may close this issue.

2 participants