From 3af93976895cffc5571afa30bb6287f571cfc8b2 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Fri, 17 Apr 2026 12:08:03 +0200 Subject: [PATCH] move removeWidgetClones and this.mode=MODE_IDLE into _cleanupDragging function --- public/js/components/Drop/Grid.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/public/js/components/Drop/Grid.js b/public/js/components/Drop/Grid.js index c876d698a..07ae8a1b3 100644 --- a/public/js/components/Drop/Grid.js +++ b/public/js/components/Drop/Grid.js @@ -471,35 +471,30 @@ export default { this.checkPinnedWidgetAnimation(); } }, - removeWidgetClones() { - let widgetClones = Array.from(document.getElementsByClassName("widgetClone")); - for (let i = 0; i < widgetClones.length; i++) { - this.$refs.container.removeChild(widgetClones[i]); - } - }, _cleanupDragging() { + this.mode = MODE_IDLE; if (this.draggedItem) { const draggedItem = this.indexedItems.find(item => item.index == this.draggedItem.index); delete draggedItem.classes; this.draggedItem = null; } + // removeWidgetClones + let widgetClones = Array.from(document.getElementsByClassName("widgetClone")); + for (let i = 0; i < widgetClones.length; i++) { + this.$refs.container.removeChild(widgetClones[i]); + } }, dragCancel() { - this.removeWidgetClones(); this.additionalRowComputed = false; - this.mode = MODE_IDLE; this.tempPositionUpdates = null; this.draggedOffset = [0,0]; this._cleanupDragging(); }, dragEnd() { - this.removeWidgetClones(); - if (this.mode == MODE_IDLE) { return; } - this.mode = MODE_IDLE; let updated = []; this.convertGridResultToUpdate(this.tempPositionUpdates, updated); updated = this._updateCorrectedPositions(updated);