willmcpo / body-scroll-lock

Body scroll locking that just works with everything 😏
MIT License
4.04k stars 338 forks source link

Doesn't seem to lock HTML tag scrolling #244

Open ryanbadger opened 2 years ago

ryanbadger commented 2 years ago

Not sure if it was intentional, but if the html element has any form of overflow:scroll set in the CSS, this lib doesn't work fully, you can still scroll.

A quick fix is just to add the scroll lock to the HTML tag when scroll is disabled:

document.documentElement.style.overflow = "hidden";

samsonCao commented 2 years ago

https://github.com/willmcpo/body-scroll-lock/issues/244#issue-1115863641 this issue solved my problem, very thankful

rick-liruixin commented 1 year ago

They stopped the repairs. I had to do it myself, in the same way, with a new version of typeScript. And fix these problems for everyone to use. add react hooks、vue3 example

npm i body-scroll-lock-upgrade

repair log,Refer to the releases page.