diff --git a/packages/stack/src/views/Stack/Card.tsx b/packages/stack/src/views/Stack/Card.tsx index ad031964..a1b9e812 100755 --- a/packages/stack/src/views/Stack/Card.tsx +++ b/packages/stack/src/views/Stack/Card.tsx @@ -366,6 +366,15 @@ export default class Card extends React.Component { set(this.nextIsVisible, UNSET), ]) ), + onChange( + this.isVisible, + call([this.isVisible], ([isVisible]) => (this.isVisibleValue = isVisible)) + ), + ]); + + private execNoGesture = this.runTransition(this.isVisible); + + private execWithGesture = block([ onChange( this.isSwiping, call( @@ -454,10 +463,6 @@ export default class Card extends React.Component { ), ] ), - onChange( - this.isVisible, - call([this.isVisible], ([isVisible]) => (this.isVisibleValue = isVisible)) - ), ]); private handleGestureEventHorizontal = Animated.event([ @@ -576,15 +581,21 @@ export default class Card extends React.Component { layout ); - const handleGestureEvent = - gestureDirection === 'vertical' + const handleGestureEvent = gestureEnabled + ? gestureDirection === 'vertical' ? this.handleGestureEventVertical - : this.handleGestureEventHorizontal; + : this.handleGestureEventHorizontal + : undefined; return ( + {this.props.gestureEnabled ? ( + + ) : ( + + )} {overlayEnabled && overlayStyle ? (