rommguy / react-custom-scroll

Easily customize the browser scroll bar with native OS scroll behavior
MIT License
555 stars 66 forks source link

Smooth scrolling #81

Open AdamMadrzejewski opened 4 years ago

AdamMadrzejewski commented 4 years ago

I would suggest implementing a smooth scrolling. From one of the latest issues, I've found that the scroll speed #80 can't be implemented as the library uses the native scrolls. Anyway, the smooth scroll property is native.

In my code, I have used this code to achieve the smooth scrolling

    customScrollRef.current.innerContainerRef.current.scroll({
        behavior: 'smooth',
        left: 0,
        top: contentScrollTopValue
    })

It would be great to have a boolean property on the CustomScroll like smoothScroll={true}, probably true by default would be a better initial value.

What do you think about it?