Collection form items: fixed dragover detection when going up
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user