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) {
|
||||
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
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user