diff --git a/reorderable/src/commonMain/kotlin/sh/calvin/reorderable/ReorderableLazyCollection.kt b/reorderable/src/commonMain/kotlin/sh/calvin/reorderable/ReorderableLazyCollection.kt index d9f8172..2b45074 100644 --- a/reorderable/src/commonMain/kotlin/sh/calvin/reorderable/ReorderableLazyCollection.kt +++ b/reorderable/src/commonMain/kotlin/sh/calvin/reorderable/ReorderableLazyCollection.kt @@ -506,6 +506,14 @@ open class ReorderableLazyCollectionState internal constructor( onMoveStateMutex.unlock() return } + val isDraggingItemAtEnd = when (direction) { + Scroller.Direction.FORWARD -> draggingItem.index == state.layoutInfo.visibleItemsInfo.lastOrNull()?.index + Scroller.Direction.BACKWARD -> draggingItem.index == state.firstVisibleItemIndex + } + if (isDraggingItemAtEnd) { + onMoveStateMutex.unlock() + return + } val dragOffset = draggingItemOffset.reverseAxisIfNecessary() .reverseAxisWithLayoutDirectionIfLazyVerticalStaggeredGridRtlFix() val startOffset = draggingItem.offset.toOffset() + dragOffset