atomiks / elastic-scroll-polyfill

macOS/iOS elastic scroll polyfill on scrollable elements

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple rebounds when using mouse wheel with inertia

capi1O opened this issue · comments

First thank your work, I use it as a React wrapper as described in the doc and it worked right out of the box, simply brilliant...

I have one small issue however, I have a mouse Logitech MX Master which has some kind of inertia on the wheel, that is if you scroll fast it will keep scrolling on its own for a bit (physically, that is the wheel is still turning.

In this case I see multiple rebounds when reaching the bottom of the scrollable element, typically 3.

Interestingly this only happens when scrolling to bottom, no extra rebounds on top (while the wheel is still turning).

// Prevent a bounce if already at the edge
if (innerWrap.style.transform !== 'translate3d(0px, 0px, 0px)') {
innerWrap.style.transition = 'none'
innerWrap.style.transform = RESET_TRANSFORM
}

Maybe something here?