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

react-fullpage prevent my horizontal swipe event #55

Open
amerllica opened this issue Feb 28, 2018 · 2 comments
Open

react-fullpage prevent my horizontal swipe event #55

amerllica opened this issue Feb 28, 2018 · 2 comments

Comments

@amerllica
Copy link

I'm using pure CSS horizontal carousel in mobile view, Like google mobile version carousel, Just like below image:

carousel google

But when I use react-fullpage, it doesn't work, also when I swipe horizontal then I see none in browser console, it means not up or down, and I believe react-fullpage prevent this action.

I think it is a BUG, if not how can I settle my issue?

@cntrlz
Copy link

cntrlz commented May 24, 2018

It's likely that when the SectionsContainer adds an event listener for touchmove, it also prevents default:

touchsurface.addEventListener('touchmove', function (e) {
                e.preventDefault(); // prevent scrolling when inside DIV
            }, false);

This is on line 271 in /dist or 225 in /src in your node_modules/react-fullpage folder.

You can comment-out the line e.preventDefault(); or just remove the event listener entirely. I myself had the same issue, but doing this might introduce other bugs. Still checking on that.

@amerllica
Copy link
Author

I can not understand why react-fullpage developer or developers use e.preventDefault(), I settled my problem with a different solution, I use Hammer.js touch tracking function and control the horizontal scroll bar.

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

2 participants