Skip to content

Commit 756eb94

Browse files
committed
fix bug when row released without moving
1 parent 779dc2d commit 756eb94

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,6 @@ class DraggableFlatList<T> extends React.Component<Props<T>, State> {
687687
]);
688688

689689
onGestureRelease = [
690-
set(this.isPressedIn.native, 0),
691690
cond(
692691
this.isHovering,
693692
[
@@ -855,6 +854,10 @@ class DraggableFlatList<T> extends React.Component<Props<T>, State> {
855854
);
856855
}
857856

857+
onContainerTouchEnd = () => {
858+
this.isPressedIn.native.setValue(0);
859+
};
860+
858861
render() {
859862
const { scrollEnabled, debug, horizontal, activationDistance } = this.props;
860863
const { hoverComponent } = this.state;
@@ -876,6 +879,7 @@ class DraggableFlatList<T> extends React.Component<Props<T>, State> {
876879
style={styles.flex}
877880
ref={this.containerRef}
878881
onLayout={this.onContainerLayout}
882+
onTouchEnd={this.onContainerTouchEnd}
879883
>
880884
<AnimatedFlatList
881885
{...this.props}
@@ -894,6 +898,10 @@ class DraggableFlatList<T> extends React.Component<Props<T>, State> {
894898
<Animated.Code>
895899
{() =>
896900
block([
901+
onChange(
902+
this.isPressedIn.native,
903+
cond(not(this.isPressedIn.native), this.onGestureRelease)
904+
),
897905
onChange(this.touchAbsolute, this.checkAutoscroll),
898906
cond(clockRunning(this.hoverClock), [
899907
spring(

0 commit comments

Comments
 (0)