diff --git a/front/src/CollectionForm.vue b/front/src/CollectionForm.vue index 40477d0..392d34e 100644 --- a/front/src/CollectionForm.vue +++ b/front/src/CollectionForm.vue @@ -49,10 +49,13 @@ function checkGrabbedPosition(itemId, y) { if (it.$props.id == itemIdBeingGrabbed.value) { return } - if ( - it.$el.offsetTop + it.$el.offsetHeight / 2 < itemMovedY && - itemMovedY < it.$el.offsetTop + (3 * it.$el.offsetHeight) / 2 - ) { + let lowerDetectionY = it.$el.offsetTop + it.$el.offsetHeight / 2 + let upperDetectionY = it.$el.offsetTop + (3 * it.$el.offsetHeight) / 2 + if (it.$props.position < itemBeingMoved.$props.position) { + lowerDetectionY = it.$el.offsetTop + upperDetectionY = it.$el.offsetTop + it.$el.offsetHeight / 2 + } + if (lowerDetectionY < itemMovedY && itemMovedY < upperDetectionY) { itemIdBeingOvered.value = it.$props.id } })