magic-akari / seamless-scroll-polyfill

Scroll Behavior polyfill
https://www.npmjs.com/package/seamless-scroll-polyfill
MIT License
159 stars 12 forks source link

Cannot set custom duration when using elementScrollIntoViewPolyfill #149

Closed alaraayan closed 9 months ago

alaraayan commented 9 months ago

I use seamless-scroll-polyfill in a Remix.run project and it works great. As an enhancement I also want to slow down the transition and add my custom duration. This seems to be possible in the source code as it checks for a duration coming in from the config or uses 500 as default. I've tried to pass my custom duration as

elementScrollIntoViewPolyfill({ duration: 2000 });

and

elementScrollIntoViewPolyfill({ config: { duration: 2000 } });.

Neither of these worked. Can you please help with where and how to implement a custom duration? Thank you!

alaraayan commented 9 months ago

Closing this as there is already a fix in #133