Skip to content

Commit bce0838

Browse files
Philipp Benjamin Köppchenscottgonzalez
Philipp Benjamin Köppchen
authored andcommitted
Droppable: greedy children now consider only parents with same scope as parents. Fixed #8524 - Nested greedy droppables trigger parents events even when scopes are different
1 parent 96cabd5 commit bce0838

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ui/jquery.ui.droppable.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,12 @@ $.ui.ddmanager = {
253253

254254
var parentInstance;
255255
if (this.options.greedy) {
256-
var parent = this.element.parents(':data(droppable):eq(0)');
256+
// find droppable parents with same scope
257+
var scope = this.options.scope;
258+
var parent = this.element.parents(':data(droppable)').filter(function () {
259+
return $.data(this, 'droppable').options.scope === scope;
260+
});
261+
257262
if (parent.length) {
258263
parentInstance = $.data(parent[0], 'droppable');
259264
parentInstance.greedyChild = (c == 'isover' ? 1 : 0);

0 commit comments

Comments
 (0)