mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-29 12:55:21 +08:00
fix: change order of attaching nodes in card exec
This commit is contained in:
@@ -464,7 +464,7 @@ export default class Card extends React.Component<Props> {
|
|||||||
multiply(this.velocity, SWIPE_VELOCITY_IMPACT)
|
multiply(this.velocity, SWIPE_VELOCITY_IMPACT)
|
||||||
);
|
);
|
||||||
|
|
||||||
private exec = block([
|
private exec = [
|
||||||
set(
|
set(
|
||||||
this.gesture,
|
this.gesture,
|
||||||
multiply(
|
multiply(
|
||||||
@@ -501,11 +501,25 @@ export default class Card extends React.Component<Props> {
|
|||||||
this.isVisible,
|
this.isVisible,
|
||||||
call([this.isVisible], ([isVisible]) => (this.isVisibleValue = isVisible))
|
call([this.isVisible], ([isVisible]) => (this.isVisibleValue = isVisible))
|
||||||
),
|
),
|
||||||
|
];
|
||||||
|
|
||||||
|
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([
|
private execWithGesture = block([
|
||||||
|
...this.exec,
|
||||||
onChange(
|
onChange(
|
||||||
this.isSwiping,
|
this.isSwiping,
|
||||||
call(
|
call(
|
||||||
@@ -602,6 +616,7 @@ export default class Card extends React.Component<Props> {
|
|||||||
),
|
),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
|
this.changeVisiblityExec,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
private handleGestureEventHorizontal = Animated.event([
|
private handleGestureEventHorizontal = Animated.event([
|
||||||
@@ -757,7 +772,6 @@ export default class Card extends React.Component<Props> {
|
|||||||
return (
|
return (
|
||||||
<StackGestureContext.Provider value={this.gestureRef}>
|
<StackGestureContext.Provider value={this.gestureRef}>
|
||||||
<View pointerEvents="box-none" {...rest}>
|
<View pointerEvents="box-none" {...rest}>
|
||||||
<Animated.Code exec={this.exec} />
|
|
||||||
<Animated.Code
|
<Animated.Code
|
||||||
key={gestureEnabled ? 'gesture-code' : 'no-gesture-code'}
|
key={gestureEnabled ? 'gesture-code' : 'no-gesture-code'}
|
||||||
exec={gestureEnabled ? this.execWithGesture : this.execNoGesture}
|
exec={gestureEnabled ? this.execWithGesture : this.execNoGesture}
|
||||||
|
|||||||
Reference in New Issue
Block a user