From 374f2cbb55a026630bbb355d7e4cc1976908bf72 Mon Sep 17 00:00:00 2001 From: Paul Bakaus Date: Fri, 21 Aug 2009 14:13:47 +0000 Subject: [PATCH] draggable: direct removal of draggable element on drop event doesnt make used plugins fire an error anymore, fixes #4550 --- ui/ui.draggable.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/ui.draggable.js b/ui/ui.draggable.js index ffda4a3f4..322592f1e 100644 --- a/ui/ui.draggable.js +++ b/ui/ui.draggable.js @@ -157,6 +157,10 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, { dropped = this.dropped; this.dropped = false; } + + //if the original element is removed, don't bother to continue + if(!this.element[0] || !this.element[0].parentNode) + return false; if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { var self = this; -- 2.39.5