Fixed ticket #7800 - Draggable helper="clone" doesn't remove the dragged clone if original element is removed upon drop #501
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed ticket: http://bugs.jqueryui.com/ticket/7800
Test case here: http://jsfiddle.net/maljub01/btESH/
Another (more useful) test case: http://jsfiddle.net/maljub01/mJZva/
This fix has two parts, the first, in Draggable, prevents it from aborting mouseStop when the element is gone if the helper is !== "original". Returning the modified if statement to the way it looked in v1.8.16.
The second part, in Core, was necessary for IE8 and older versions of IE. This is because for old IE, parentNode returns a node with nodeType === 11 (DOCUMENT_FRAGMENT_NODE) for elements that have no parent.
At first I wanted to add the nodeType === 11 check to the modified line in Draggable to avoid modifying Core. However, the error persists even if the check was added there.
Here's a test case, with the option of monkey-patching jQuery UI with this commit's modifications: http://jsfiddle.net/maljub01/ahyfr/