react-use-draggable-scroll
react-use-draggable-scroll copied to clipboard
Doesnt work with smooth-scroll
I noticed that when smooth-scroll is added to an element the hook stops working. I couldn't find a way around.
I have the same problem myself.
I had this issue, but I realised I only needed the smooth scroll when the user clicked one of the toggle arrows, so I have this handler:
function handleScrollButton(scrollOffset) {
scrollerContainer.current.classList.add('scroll-smooth')
scrollerContainer.current.scrollLeft += scrollOffset
scrollerContainer.current.classList.remove('scroll-smooth')
}
It adds the smooth-scroll tailwind class, performs the scroll, then removes it again. Hacky, but it works.