fromBram.us
1 week agoUse overscroll-behavior: contain to prevent a page from scrolling while a is open
While this change might seem trivial, it fixes an issue developers have been dealing with for ages: prevent a page from scrolling while a (modal) <dialog> is open. ~ CSS overscroll-behavior - which I first covered here in 2017 - allows you to control what a browser should do when reaching the boundary of a scrolling area. For example, if you set it to overscroll-behavior: contain, it will prevent scroll chaining from happening, so that underlying elements don't scroll.
Web development