fix: reset velocity if no modal animation

This commit is contained in:
osdnk
2019-12-09 20:42:42 +01:00
parent 9cd6791ac2
commit a5b389837d

View File

@@ -104,6 +104,7 @@ const GESTURE_RESPONSE_DISTANCE_VERTICAL = 135;
const {
abs,
add,
and,
block,
call,
cond,
@@ -679,6 +680,13 @@ export default class Card extends React.Component<Props> {
this.isSwipeCancelled,
eq(this.gestureState, GestureState.CANCELLED)
),
cond(
and(
eq(this.gestureState, GestureState.END),
lessThan(this.velocity, 0)
),
[set(this.velocity, 0), set(this.velocityUntraversed, 0)]
),
set(this.isSwiping, FALSE_NODE),
this.runTransition(
cond(