From 1c80735acb20a468300a53f85ef49b065d40af3e Mon Sep 17 00:00:00 2001 From: Zaven Muradyan Date: Sat, 23 Feb 2013 21:55:29 -0800 Subject: Droppable: Changed drop event to loop over a copied array instead of the droppables directly. Fixed #9116 - Droppable: Drop event can cause droppables to remain active if any droppable is created/destroyed in the event handler. --- ui/jquery.ui.droppable.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js index 4fbfcde06..552b24a58 100644 --- a/ui/jquery.ui.droppable.js +++ b/ui/jquery.ui.droppable.js @@ -278,7 +278,8 @@ $.ui.ddmanager = { drop: function(draggable, event) { var dropped = false; - $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + // Create a copy of the droppables in case the list changes during the drop (#9116) + $.each(($.ui.ddmanager.droppables[draggable.options.scope] || []).slice(), function() { if(!this.options) { return; -- cgit v1.2.3