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

Prevent Vertical Scrolling During Mobile Horizontal swipe #49

Open
Stovetopdropp opened this issue Jan 20, 2020 · 5 comments
Open

Prevent Vertical Scrolling During Mobile Horizontal swipe #49

Stovetopdropp opened this issue Jan 20, 2020 · 5 comments

Comments

@Stovetopdropp
Copy link

Im having some issues on mobile with the horizontal swipe. I am using a horizontal swipe event on a carousel which does work, however the page typically scrolls vertically while the swipe is happening if the users finger does not move perfectly straight across the screen. Is there a way to prevent vertical page scrolling during a left or right swipe event?

@kirkbushell
Copy link

I've found also that if you vertically scroll, sometimes the horizontal swipe will trigger, which is not ideal. It needs to be able to differentiate between the two.

@kirkbushell
Copy link

haha, nevermind. Figured out what I was doing wrong.

@jerrybendy
Copy link
Owner

ah... What happened? Could you share something to us?

@kirkbushell
Copy link

Basically, swiping also triggers bottom/top - you need to make sure you ignore these. My code was waiting on a swipe, but didn't differentiate between the two.

For your issue in particular, I'm not sure you can stop people swiping up/down.

@jerrybendy
Copy link
Owner

User scrolling is not allowed to prevent here. You can judge the direction in swipe callback to know this event is what you want or not.

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