Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
fix: don't remove route if animation isn't finished when dragging (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
osdnk authored and satya164 committed Sep 16, 2019
1 parent d83d3de commit 6af8400
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/stack/src/views/Stack/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,13 @@ export default class Card extends React.Component<Props> {
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
)
),
Expand All @@ -584,16 +590,10 @@ export default class Card extends React.Component<Props> {
)
),
// 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),
Expand Down

0 comments on commit 6af8400

Please sign in to comment.