-
Notifications
You must be signed in to change notification settings - Fork 149
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
Provide deltas relative to initial onTouchStart in onSwiping callback #160
Comments
Hey @samanpwbb, thanks for posting an issue with some ideas. I think i'm having a hard time trying to understand exactly what you're looking for.
We can also try and help clean this code up a bit.
By introducing a I'm absolutely open to taking a look at and considering a PR for what you're looking for and/or I can try and create a PR if we can clarify these a bit more. Cheers! |
Thanks for getting back to me!
After fiddling with my code a bit, I realize that it's necessary to throttle the onSwiping events, so deltas from previous events wouldn't help me unless react-swipeable did the throttling internally. It'd be awesome if it did, but that really expands the scope of this feature request 😄. Your last suggestion is my favorite:
I think we could close this issue if just this feature was added. I'll try to find the time to put up a PR for you. |
Closing with #162 |
Right now, a single swipe will return multiple
onSwiping
calls. In the app I'm building, I'm using deltaX and deltaY to show immediate feedback as user is swiping, but I don't want the deltas from every sub-event to accumulate. I wrote some code that looks like this:It'd be nice if I didn't have to write this code:
onSwiping
could provide deltas relative to start of the swipe in addition to providing full deltas for each onSwiping event as it does now.onSwiping
could include aninitialEvent
so implementers could then more easily make deltas relative.The text was updated successfully, but these errors were encountered: