CIS4 Dashboard: add workaround for chrome fireing event dragend when styles are manipulated during dragging

This commit is contained in:
Harald Bamberger
2025-08-07 13:35:47 +02:00
parent 4f2499862f
commit 8494033bda
+13 -10
View File
@@ -408,16 +408,19 @@ export default {
this.draggedItem = item;
this.$emit('draggedItem',item);
this.draggedNode = evt.target.closest(".drop-grid-item");
//clones the widget for the drag Image
let clone = evt.target.closest(".drop-grid-item")?.cloneNode(true);
clone.style.zIndex = 5;
clone.classList.add("widgetClone");
this.$refs.container.appendChild(clone);
this.clonedWidget = clone;
this.$emit('draggedItem', item);
// workaround for chrome fireing event dragend when styles are manipulated during dragging
setTimeout(() => {
this.draggedNode = evt.target.closest(".drop-grid-item");
//clones the widget for the drag Image
let clone = evt.target.closest(".drop-grid-item")?.cloneNode(true);
clone.style.zIndex = 5;
clone.classList.add("widgetClone");
this.$refs.container.appendChild(clone);
this.clonedWidget = clone;
}, 0);
this.draggedOffset = [item.x - this.x, item.y - this.y];
this._dragStart(evt, item);
},