Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesnt work with smooth-scroll #20

Open
Hristo-Spasov opened this issue Mar 21, 2023 · 2 comments
Open

Doesnt work with smooth-scroll #20

Hristo-Spasov opened this issue Mar 21, 2023 · 2 comments

Comments

@Hristo-Spasov
Copy link

I noticed that when smooth-scroll is added to an element the hook stops working.
I couldn't find a way around.

@gustav-pettersson-nordnet

I have the same problem myself.

@JayBox325
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants