From 1e1852cf17c3121608a3ac28210ffca993f60f85 Mon Sep 17 00:00:00 2001 From: Kirill Bukaev Date: Wed, 25 Oct 2023 20:02:46 +0300 Subject: [PATCH] fix: cancel dragging when list item is invisible --- lib/flutter_reorderable_list.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/flutter_reorderable_list.dart b/lib/flutter_reorderable_list.dart index 946a170..5a08ee1 100644 --- a/lib/flutter_reorderable_list.dart +++ b/lib/flutter_reorderable_list.dart @@ -388,7 +388,10 @@ class _ReorderableListState extends State this._scrollable!.position.removeListener(this._scrolled); var current = _items[_dragging]; - if (current == null) return; + if (current == null) { + _cancel(); + return; + } final originalOffset = _itemOffset(current); final dragProxyOffset = _dragProxy!.offset;