From a71f6eb536e673a231bd02bf64e9eeef8dc91614 Mon Sep 17 00:00:00 2001 From: Dariusz Szut Date: Tue, 7 Feb 2017 15:25:43 +0100 Subject: [PATCH] fix - placeholder added in wrong place with nested dragster instances --- dragster.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dragster.js b/dragster.js index f791fb3..6922abf 100644 --- a/dragster.js +++ b/dragster.js @@ -746,8 +746,11 @@ * @param regionTarget {HTMLElement} a region drop target */ addPlaceholderInRegionBelowTargets: function (regionTarget) { - var elementsInRegion = regionTarget.getElementsByClassName(CLASS_DRAGGABLE), - dropTarget = elementsInRegion[elementsInRegion.length - 1], + var elementsInRegion = [].slice.call(regionTarget.getElementsByClassName(CLASS_DRAGGABLE)), + filteredElements = elementsInRegion.filter(function (elementInRegion) { + return elementInRegion.dataset.dragsterId === dragsterId; + }), + dropTarget = filteredElements[filteredElements.length - 1], placeholder = createPlaceholder(); placeholder.dataset.placeholderPosition = POS_BOTTOM;