<p>I have a <a href="https://jqueryui.com/draggable/" rel="nofollow noreferrer"><code>draggable</code></a> with a custom <a href="http://api.jqueryui.com/draggable/#option-helper" rel="nofollow noreferrer"><code>helper</code></a>. Sometimes the helper is a clone and sometimes it is the original element. </p>

<p>The problem is that when the helper is the original element and is <strong>not</strong> dropped on a valid droppable it gets removed. My solution looks like this so far:</p>

<p>in my <code>on_dropped</code> callback I set <code>ui.helper.dropped_on_droppable</code> to <code>true</code>;</p>

<p>In the <code>stop</code> callback of the draggable, I check for that variable and then ... what do I do? </p>

<pre><code>$('.my_draggable').draggable({
    stop   : function(e, ui) {
        if (!ui.helper.dropped_on_droppable) {
            /* what do I do here? */
        }
    },
</code></pre>

<p>Is this even the right approach?</p>

I might be missing something here, but is it not simply a case of adding
```
```
revert: "invalid"
```
```
to the options of the draggable if the draggable is of an original element, not a clone?