davideperozzi / smoovy

A collection of small and useful js packages (smooth scrolling, router, parallax, webgl, utils, etc.) preventing copy & paste
MIT License
79 stars 8 forks source link

Using native browser scrollbar #10

Closed davidstellini closed 4 years ago

davidstellini commented 4 years ago

Hi!

Great job on an amazing library - I love the structure, the reuse, and the TypeScript :)

I have a question I couldn't figure out from the docs. Is it possible to show the native browser scrollbar? It doesn't seem very happy with setting overflow-y: scroll on smoovy-container.

davideperozzi commented 4 years ago

Hi David!

Thank you :)

A native scrollbar is possible. I created a special configuration for it here: https://github.com/davideperozzi/smoovy/blob/master/packages/scroller/src/scroller.ts#L32-L77

It should work out of the box after replacing smoothScroll with nativeSmoothScroll.

Some things you should keep in mind when using the native scrollbar approach:

You can checkout a live example here: https://www.hoepfner-braeu.de/iwerkx/

I hope this solves you problem :) Feel free to ask, if you have further questions!

davidstellini commented 4 years ago

Thanks :) Worked immediately!