Collection form items: fixed dragover detection when going up

This commit is contained in:
2026-04-14 15:43:28 +02:00
parent e746e67e89
commit 11a23d174e

View File

@@ -49,10 +49,13 @@ function checkGrabbedPosition(itemId, y) {
if (it.$props.id == itemIdBeingGrabbed.value) { if (it.$props.id == itemIdBeingGrabbed.value) {
return return
} }
if ( let lowerDetectionY = it.$el.offsetTop + it.$el.offsetHeight / 2
it.$el.offsetTop + it.$el.offsetHeight / 2 < itemMovedY && let upperDetectionY = it.$el.offsetTop + (3 * it.$el.offsetHeight) / 2
itemMovedY < 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 itemIdBeingOvered.value = it.$props.id
} }
}) })