nrkno / core-components

Accessible and lightweight Javascript components
https://static.nrk.no/core-components/latest/
MIT License
117 stars 10 forks source link

core-dialog: Prevent background scrolling when open option #616

Closed eirikbacker closed 2 years ago

eirikbacker commented 3 years ago

As a user I want, html/body scrolling to stop when dialog is open - can this be an option core-dialog fixes for me?

eirikbacker commented 2 years ago

Wait a minute - maybe this is the solution: https://ishadeed.com/article/prevent-scroll-chaining-overscroll-behavior/

skjalgepalg commented 2 years ago

Overscroll-behavior sounds like it should solve this for most cases.

https://caniuse.com/?search=overscroll-behavior

eirikbacker commented 2 years ago

@skjalgepalg jupp :) maybe mention it in the docs as this is quite a new feature and our users might not be aware of it? as overscroll-behavior is nice to have and not a must, I do not see safari not supporting it (yet) as a blocker :)