Closed Ricard-Garcia closed 7 months ago
You need to call new Lenis() on every element you need to be smooth scrolled
Is there a documentation for this? Could it be possible to instantiate Lenis using <ReactLenis>
instead of a new instance using new Lenis()
.
Thanks beforehand, @clementroche.
just use
@Ricard-Garcia, please if the issue is ReactLenis related, use the issues board there, since it could be useful for other users too!
after a quick check I've found someone else already asked that question, and got an answer and examples, here's the link to that issue
That's true, thanks for pointing out the previous issue under the same topic @arzafran !
Describe the bug Smooth scroll lost when scroll is nested.
To Reproduce I'm using
ReactLenis
component withroot
in a project and usingstop()
to lock the scroll when opening a modal. The problem is that, sometimes modals have scroll overflow and using these data attributes makes the content scrollable again but without the smooth scroll.Do I need to
stop()
the rootReactLenis
component and use a different instance inside the modal or isLenis
not supporting nested scrolls with smooth behaviour?Thanks, Ricard.