From 6af84004217068af0be09f97c814e395a80c9901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Osadnik?= Date: Mon, 16 Sep 2019 21:02:49 +0200 Subject: [PATCH] fix: don't remove route if animation isn't finished when dragging (#100) --- packages/stack/src/views/Stack/Card.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/stack/src/views/Stack/Card.tsx b/packages/stack/src/views/Stack/Card.tsx index 3ee1bb1a..441ec4b9 100755 --- a/packages/stack/src/views/Stack/Card.tsx +++ b/packages/stack/src/views/Stack/Card.tsx @@ -574,7 +574,13 @@ export default class Card extends React.Component { this.offset, cond( this.distance, - divide(this.gesture, this.distance), + divide( + multiply( + this.gestureUntraversed, + I18nManager.isRTL ? MINUS_ONE_NODE : TRUE_NODE + ), + this.distance + ), TRUE_NODE ) ), @@ -584,16 +590,10 @@ export default class Card extends React.Component { ) ), // Stop animations while we're dragging - // and invoke proper listener cond( clockRunning(this.clock), - call([this.toValue], ([target]) => { + call([], () => { this.isRunningAnimation = false; - if (target) { - this.props.onOpen(false); - } else { - this.props.onClose(false); - } }) ), stopClock(this.clock),