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

Commit

Permalink
fix: change order of attaching nodes in card exec
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Sep 3, 2019
1 parent 798a905 commit 167d58c
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions packages/stack/src/views/Stack/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ export default class Card extends React.Component<Props> {
multiply(this.velocity, SWIPE_VELOCITY_IMPACT)
);

private exec = block([
private exec = [
set(
this.gesture,
multiply(
Expand Down Expand Up @@ -486,15 +486,25 @@ export default class Card extends React.Component<Props> {
set(this.nextIsVisible, UNSET_NODE),
])
),
];

private changeVisiblityExec = onChange(
this.isVisible,
call([this.isVisible], ([isVisible]) => (this.isVisibleValue = isVisible))
);

private execNoGesture = block([
...this.exec,
this.runTransition(this.isVisible),
onChange(
this.isVisible,
call([this.isVisible], ([isVisible]) => (this.isVisibleValue = isVisible))
),
this.changeVisiblityExec,
]);

private execNoGesture = this.runTransition(this.isVisible);

private execWithGesture = block([
...this.exec,
onChange(
this.isSwiping,
call(
Expand Down Expand Up @@ -591,6 +601,7 @@ export default class Card extends React.Component<Props> {
),
]
),
this.changeVisiblityExec,
]);

private handleGestureEventHorizontal = Animated.event([
Expand Down Expand Up @@ -730,7 +741,7 @@ export default class Card extends React.Component<Props> {
return (
<StackGestureContext.Provider value={this.gestureRef}>
<View pointerEvents="box-none" {...rest}>
<Animated.Code exec={this.exec} />
{/* <Animated.Code exec={this.exec} /> */}
<Animated.Code
key={gestureEnabled ? 'gesture-code' : 'no-gesture-code'}
exec={gestureEnabled ? this.execWithGesture : this.execNoGesture}
Expand Down

0 comments on commit 167d58c

Please sign in to comment.