Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't seem to lock HTML tag scrolling #244

Open
ryanbadger opened this issue Jan 27, 2022 · 2 comments
Open

Doesn't seem to lock HTML tag scrolling #244

ryanbadger opened this issue Jan 27, 2022 · 2 comments

Comments

@ryanbadger
Copy link

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
Copy link

samsonCao commented May 30, 2022

#244 (comment)
this issue solved my problem, very thankful

@rick-liruixin
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants