Replace custom scroll-lock logic with package body-scroll-lock #809
marcobusemann
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey, first of all thanks for your great work on this library. It really makes our lives much easier, especially in terms of accessibility. Before we started using headlessui, we created our own
Dialog
component. As part of that, we used the packagebody-scroll-lock
to prevent scrolling and hide the scrollbar while the dialog is open. This worked very well across different platforms and browsers. Especially on MacOS with its different scrollbar settings.Now we noticed that headlessui tries to do a similar thing by using a very simple approach (always add a padding-right to the html element if the dialog is visible). Unfortunately this approach does not work very well in some scenarios.
Thats why I would like to suggest:
Dialog
to disable the scroll-lock behaviourWould be happy to provide a pull request if you think one of those options would be fine.
Beta Was this translation helpful? Give feedback.
All reactions