Skip to content

Commit

Permalink
HFP-3610 Do not change element position if already in dropzone
Browse files Browse the repository at this point in the history
  • Loading branch information
otacke committed Oct 21, 2022
1 parent 7f5cdc9 commit c6d2234
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/drag-question.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c6d2234

Please sign in to comment.