darkroomengineering / lenis

How smooth scroll should be
https://lenis.darkroom.engineering
MIT License
9k stars 384 forks source link

Native scrolling (scrollbar and keyboard) is blocked/prevented during lenis scroll animation #107

Open thasmo opened 1 year ago

thasmo commented 1 year ago

Describe the bug During the lenis scroll animaton, scrolling via scrollbar or keyboard shortcut (scrollbar) is blocked/prevented (by lenis). In other words, the scroll animation, triggered/executed by lenis, can not be interrupted/cancelled by native scrolling via scrollbar or space bar.

Imo when scrolling natively (via scrollbar, spacebar, etc.) the current scroll animation should be cancelled/stopped immediately to give the user control over the scroll experience/behavior.

To Reproduce codepen

clementroche commented 1 year ago

Let me explain how lenis works:

So because there is no way to discriminate native scroll events over scroll events triggered by lenis animation, your ask seems impossible. Currently the only way the user can take control over the scrollTo animation is to scroll using MouseWheel

thasmo commented 1 year ago

@clementroche, got it - makes sense; I know the "problem". Wish it would be possible tho. 😅