Reason for no ability to control scroll lock on dialog #510
Replies: 3 comments 5 replies
-
I have the same question. I have a use-case where I have a form inside the slide-over and the document renders a preview as the user fills in the form inside the slide-over. Since the preview can get quite long, I want the user to be able to scroll it, even with the slide-over being open. |
Beta Was this translation helpful? Give feedback.
-
Hey! Thank you for your suggestion! When working with a Dialog, you have to think as if it is a separate page. From an accessibility perspective, screenreader users are not able to interact with the content outside of the Dialog. That's one of the reasons why we have focus trapping going on. Being able to scroll in the background, is technically interacting with the "outside world". While we could provide an option to disable this behaviour, it makes that content for sighted users accessible, but it will still not be accessible for screenreader users or people that use other assistive technology, which will make this option a no-go. Instead, what you could do is not use a Dialog at all, keep it visually the exact same way. You do lose other features if you don't use a Dialog. But you have to decide what kind of features you want while keeping accessibility in mind. |
Beta Was this translation helpful? Give feedback.
-
You can add simple these lines in your css file this will resolve the issue
|
Beta Was this translation helpful? Give feedback.
-
I think headless UI is amazing, but I feel like the the ability to scroll on the outside of a Dialog is very useful in some cases (e.g. slide over) and with such a barebone UI library, I would think it would not be forced or at least controllable.
I was wondering if their was some reason of not exposing the ability to adjust or disable the scroll lock on a dialog?
If not I'm more than happy to open a pull request for it.
Beta Was this translation helpful? Give feedback.
All reactions