ashthornton / asscroll

Ash's Smooth Scroll 🍑
MIT License
947 stars 27 forks source link

scrollTo on touch devices has no easing #67

Closed iamlinkus closed 2 years ago

iamlinkus commented 2 years ago

I noticed that the scrollTo method when used on touch devices jumps to the position instead of easing into it. Is this by design or is this a bug?

ashthornton commented 2 years ago

Hi @iamlinkus , touch devices use native scroll so there isn't any natural easing when setting the scroll position, which is what scrollTo() does. On touch devices this function essentially is an alias for window.scrollTo() so you don't have to manually switch in your code when you need to do the same. If you want to ease to a position on touch devices then you'll need to handle this yourself.