joakimbeng / react-swiper

Detects and triggers touch events for swiping such as onSwipeLeft, onSwipeDown, etc. with ReactJS
140 stars 22 forks source link

Scrolling support #1

Open igal1c0de4n opened 9 years ago

igal1c0de4n commented 9 years ago

Hello Great plugin, thanks for sharing! This is not an issue but a use-case question: Say I use react-swiper on a mobile client. I want the right/left swipe events to pull in/out a menu. Also, I want the up/down swipes to work normally - scroll the page. That's for viewing content which does not fit in one screen, obviously.

I've implemented the left right swipes and noticed that when up/down swipes are ignored they do not bubble to the browser/viewport (as expected), thus up/down scrolling is not working. In the swipeUp and swipeDown events I can call window.scrollBy(0,y) to force the scroll but the result is a step-by-step scrolling and not a smooth experience as implemented by the browser/viewport.

What would be the best way to use react-swiper and have the up/down scrolling delegated to the browser/viewport, for a smooth user experience?

unity-haiwei commented 9 years ago

switch react-swipeable