darkroomengineering / lenis

How smooth scroll should be

Home Page:https://lenis.darkroom.engineering

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Smooth scrolling not working properly

Moritz-Deiaco opened this issue · comments

Describe the bug
Lenis is behaving really strange: if I scroll, theres a "timeout" and then it scrolls instantly to the position where i scrolled.

To Reproduce
I tried to reproduce the steps in codepen, but strangely, it does works there

https://github.com/studio-freight/lenis/assets/101179677/b8ee2290-ef1f-426d-b0a1-4c658c4c8dc4
^Heres A Demo Video^

Thanks for your Help

I used the boilerplate code provided in README.md

I'm pretty sure you still have scroll-behavior: smooth ?

https://github.com/studio-freight/lenis?tab=readme-ov-file#recommended-css

Thanks, it works now

Im sorry to bother again, but now, the smooth scrolling to a #anchor my site is not working anymore. Is there any way to fix this?

I also tried this onclick fix, it did not work:
<a href="#about" onclick="lenis.scrollTo('#about')" class="active" >About Me</a >

do a codepen

image

You don't use valid CSS selector as mentioned in the console, if you replace "1" with "anchor1" it works

On the codepen, it fixes it, but on my code, it doesnt, is there a problem with my css maybe?