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

Scroll stops working when adding on <body> overflow-y: scroll #419

Open
mariosmaselli opened this issue Dec 6, 2024 · 0 comments
Open

Comments

@mariosmaselli
Copy link

Describe the bug

When there is the need to block the nav bar at the top / bottom on mobile.
You will add on html overflow: hidden. And to get the scroll back then you will have on body overflow-y: scroll

You will tell lennis which one is the new wrapper and content
But it does not scroll at all

HTML structure

<html>
   <body>
      <main>
          // content...
const lenis = new Lenis({
  wrapper: document.querySelector('body'),
 content: document.querySelector('main'),
});

Code example:
https://codepen.io/mariosmaselli/pen/VYZYjGe

Maybe the wrapper & content are not the right ones?

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

1 participant