darkroomengineering / lenis

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

JS events not working on scroll #236

Closed jackkemmish closed 9 months ago

jackkemmish commented 9 months ago

Describe the bug I think I read somewhere that this is expected, but wonder if there's a way to overcome this, but if using certain events such as mouseenter or pointerenter don't trigger while scrolling. Is there a way to make sure they do?

I have an element that can be hovered any time, but it currently doesn't trigger until the page has come to a standstill.

To Reproduce A live example I found was the Lunchbox example you provided in this repo. If you hover on the "Get Demo" button which is using a mouseenter event and scroll, the animation cancels.

Similarly if you try to hover on it while the page is scrolling it doesn't trigger until the page has come to a standstill.

Hope someone could offer some advice if this is expected behaviour.

Thanks, Jack

clementroche commented 9 months ago

hmmm can you try to reproduce it with the latest lenis version ? Lunchbox was initially made with early version of lenis and has been modified since. We don't have control over the implementation anymore so i can't confirm what's causing the issue.

jackkemmish commented 9 months ago

Hi @clementroche thanks for the quick response. I updated to the latest and seems to have fixed it for my use case 👍

Sorry I should have given that a go first off.

Thanks again!