body-scroll-lock icon indicating copy to clipboard operation
body-scroll-lock copied to clipboard

Doesn't seem to lock HTML tag scrolling

Open ryanbadger opened this issue 3 years ago • 2 comments

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";

ryanbadger avatar Jan 27 '22 07:01 ryanbadger

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

samsonCao avatar May 30 '22 10:05 samsonCao

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.

rick-liruixin avatar May 06 '23 03:05 rick-liruixin