From c6d22342e4195d323ef466463aaaabd53097e87f Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Fri, 21 Oct 2022 20:08:14 +0200 Subject: [PATCH] HFP-3610 Do not change element position if already in dropzone --- src/drag-question.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/drag-question.js b/src/drag-question.js index 07b36e46..bc476f40 100644 --- a/src/drag-question.js +++ b/src/drag-question.js @@ -1137,6 +1137,14 @@ var getControls = function (draggables, dropZones, noDropzone) { var dropZone = DragUtils.elementToDropZone(dropZones, event.element); + // Don't change anything if element is in selected dropzone already + if (selected.element.dropZone === dropZone.id) { + // Reset selected + selected.element.$[0].setAttribute('aria-grabbed', 'false'); + deselect(); + return; + } + var mustCopyElement = selected.draggable.mustCopyElement(selected.element); if (mustCopyElement) { // Leave a new element for next drag