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

Doesn't work with scroll snapping #60

Open
tonygustafsson opened this issue Oct 9, 2021 · 3 comments
Open

Doesn't work with scroll snapping #60

tonygustafsson opened this issue Oct 9, 2021 · 3 comments

Comments

@tonygustafsson
Copy link

I planned to use this great tool for creating a carousel. I didn't want a continous scroll but rather the scrolling to snap to the items with scroll-snap-type: x mandatory. This makes the scrolling area not scrollable at all.

@Norserium
Copy link
Owner

Norserium commented Oct 9, 2021

@tonygustafsson, hello!

I would recommend to use the corresponding libraries for creating a carousel. There are plenty of ones. This library is designated to solve one common simple task.

Although, you can make scroll-snap work with this library. You should disable scroll-snap while dragging for this. But it will produce another problem: when you return scroll-snap the container will be scrolled immediately without any easing (on desktop).

That's how it works.

As I know all carousels that allows dragging slides by mouse and implements some sort of scroll snap, do it on their own by scripts.

@davigodoy
Copy link

Just remove class snap-x onStartScroll and restore onEndScroll

@Sam152
Copy link

Sam152 commented Dec 22, 2023

But it will produce another problem: when you return scroll-snap the container will be scrolled immediately without any easing

scroll-behavior: smooth works in some browsers to address this.

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

4 participants