Open ryanbadger opened 2 years ago
https://github.com/willmcpo/body-scroll-lock/issues/244#issue-1115863641 this issue solved my problem, very thankful
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.
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";