Skip to content

Commit 476ac8f

Browse files
committed
fix: reset cell after all gestures
1 parent 1154119 commit 476ac8f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ class DraggableFlatList<T> extends React.Component<
239239

240240
moveEndParams = [this.activeIndex, this.spacerIndex];
241241

242-
resetHoverSpring = [
242+
// Note: this could use a refactor as it combines touch state + cell animation
243+
resetTouchedCell = [
243244
set(this.touchAbsolute, this.hoverAnimConfig.toValue),
244245
set(this.touchInit, 0),
245246
set(this.activeCellOffset, 0),
@@ -775,7 +776,7 @@ class DraggableFlatList<T> extends React.Component<
775776
)
776777
]
777778
],
778-
call([this.activeIndex], this.resetHoverState)
779+
[call([this.activeIndex], this.resetHoverState), this.resetTouchedCell]
779780
)
780781
];
781782

@@ -1063,7 +1064,7 @@ class DraggableFlatList<T> extends React.Component<
10631064
this.hoverAnimConfig
10641065
),
10651066
cond(eq(this.hoverAnimState.finished, 1), [
1066-
this.resetHoverSpring,
1067+
this.resetTouchedCell,
10671068
stopClock(this.hoverClock),
10681069
call(this.moveEndParams, this.onDragEnd),
10691070
set(this.hasMoved, 0)

0 commit comments

Comments
 (0)