Potential problem with nested droppable
Working on it
- Need more info
- Not a problem
- Temporary fix
- Analyzing
- Working on it
- Solved
in Developing jQuery UI
•
13 years ago
I think this may be a problem. I have nested droppables. The inner droppables are greedy so if I drop on an inner one the outer one doesn't get dropped on. This works as expected. Both inner and outer accept the same draggables.
The draggables I'm using have revert option set to invalid. I notice that when I drop the draggable is always reverted even though the drop succeeds. This seems wrong. It doesn't happen when there is no nesting.
I think the problem is in ui.ddmanager.drop. The dropped var gets assigned to whatever droppable gets called last. The drop method shoud return whichever drop succeeded. I changed the code as follows:
$.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
var tmp;
if(!this.options) return;
if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) {
tmp = this._drop.call(this, event);
if (tmp) {
dropped = tmp;
}
}
Is this indeed a bug or am I missing something. Is the solution OK or is there a better way?
Thanks,
-John
2