You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello there, I've created a custom swipe implementation for my library as I can't use Fling gesture because it collides with my pan gesture, this custom implementation is based on time, distance moved and velocity all of this parameters are gathered at onStart and onEnd callbacks, however when it comes to testing it's not possible to trigger only onEnd callback.
Having the following code:
// onUpdate and onEnd are not called herefireGestureHandler<PanGesture>(getByGestureTestId('pan'),[{state: State.BEGAN,absoluteX: 0,absoluteY: 0},{state: State.UNDETERMINED},]);awaitwait(100)// some function that waits for 100ms// onStart and onUpdate can not be "interrupted" here.fireGestureHandler<PanGesture>(getByGestureTestId('pan'),[{state: State.END,absoluteX: 100,absoluteY: 100},]);
How can I prevent onStart from being called for the second gesture execution? Setting state undetermined as the first parameter results in the gesture not firing any of the callbacks at all.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
Hello there, I've created a custom swipe implementation for my library as I can't use Fling gesture because it collides with my pan gesture, this custom implementation is based on time, distance moved and velocity all of this parameters are gathered at
onStart
andonEnd
callbacks, however when it comes to testing it's not possible to trigger onlyonEnd
callback.Having the following code:
How can I prevent
onStart
from being called for the second gesture execution? Setting state undetermined as the first parameter results in the gesture not firing any of the callbacks at all.Beta Was this translation helpful? Give feedback.
All reactions