Skip to content

Commit 1cbd513

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
(cherry picked from commit bce0838)
1 parent 35cf028 commit 1cbd513

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ui/jquery.ui.droppable.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,12 @@ $.ui.ddmanager = {
260260

261261
var parentInstance;
262262
if (this.options.greedy) {
263-
var parent = this.element.parents(':data(droppable):eq(0)');
263+
// find droppable parents with same scope
264+
var scope = this.options.scope;
265+
var parent = this.element.parents(':data(droppable)').filter(function () {
266+
return $.data(this, 'droppable').options.scope === scope;
267+
});
268+
264269
if (parent.length) {
265270
parentInstance = $.data(parent[0], 'droppable');
266271
parentInstance.greedyChild = (c == 'isover' ? 1 : 0);

0 commit comments

Comments
 (0)