Skip to content

Commit d59fec1

Browse files
authored
fix(ios): crash when reorder long press on collectionview location without cell
Prevent handling reorder end if dragging has not started.
1 parent d2e7cca commit d59fec1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/collectionview/index.ios.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ export class CollectionView extends CollectionViewBase {
313313
}
314314
}
315315
handleReorderEnd() {
316+
if (!this.draggingStartDelta) {
317+
return;
318+
}
316319
// we call all events from here because the delegate
317320
// does not handle the case start dragging => cancel or
318321
// start dragging => end over the same item
@@ -323,6 +326,7 @@ export class CollectionView extends CollectionViewBase {
323326
this._callItemReorderedEvent(this.reorderStartingRow, this.reorderEndingRow, item);
324327
this.reorderEndingRow = -1;
325328
this.reorderEndingRow = -1;
329+
this.draggingStartDelta = null;
326330
}
327331
onReorderLongPress(gesture: UILongPressGestureRecognizer) {
328332
const collectionView = this.nativeViewProtected;

0 commit comments

Comments
 (0)