Replies: 5 comments 7 replies
-
Hi, I think we had a similar issue. I was using vite and lenis and in my prod page it always would start from the bottom. I still don't know why but I came across this video that solved the issue for me. https://www.youtube.com/watch?v=8c5eMyJR9Js&t=140s&ab_channel=BrianDesign |
Beta Was this translation helpful? Give feedback.
-
Are you using on app level ? not on each page ? If so you have to "reset" lenis on every page by using lenis.scrollTo(0, {immediate: true, force:true}) |
Beta Was this translation helpful? Give feedback.
-
Hello @clementroche I am using Next.js 14 and have a separate SmoothScrolling component (code below) which I include at the bottom of every page.tsx It works almost perfect. The issue I got is when I click on the menu item while the scroll is still moving. Then it goes to the new page in a wrong position (it doesn't scroll to top). And this is actually problematic, since the case may easily occur when I click on the footer menu quickly after getting to the bottom of the page. Any advice how to modify it to make it perfect? PS. Thanks for the great work. It's so much better than the alternatives.
|
Beta Was this translation helpful? Give feedback.
-
You're telling me that scrollTo(0, {imediate:true}) is not interrupting scrolling ? Are you using a touchpad ? Can you provide a reproduction link ? |
Beta Was this translation helpful? Give feedback.
-
Hey guys, I solved this problem using this:
and wrap this component to your children in main layout.tsx This worked for me, I hope works for others too. ✌ |
Beta Was this translation helpful? Give feedback.
-
Most of the time when I click on a Next.js Link while using Lenis, I have no problem, but I noticed recently that sometimes it will start me at the bottom of the next page or sometimes in the middle of the next page. I don't have scroll={false}. I've had to remove lenis from my website because I don't want it to occur when clients are on the site. I've seen issues with Next.js Link but having it always take you to the top while using Lenis, but I haven't seen what I'm describing. Can anyone point me in the right direction?
Beta Was this translation helpful? Give feedback.
All reactions