Sort with text node bug

by morchard

HTML

<script src="https://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<div>Sort the blue node to before the orange node and release. The sort will be cancelled, and the blue node should return to after the text node, but it will instead move next to after the orange node.</div>
<br/>
<div class="container">
    <div class="sortable-child child-orange"></div>
    text
    <div class="sortable-child child-blue"></div>
</div>

CSS

.container {
    height: 50px;
    width: 155px;
    border: 1px solid black;
    padding: 5px;
}

.sortable-child {
    display: inline-block;
    height: 50px;
    width: 50px;
    margin: 0 5px;
}

.child-orange {
    background-color: orange;
}

.child-blue {
    background-color: blue;
}

JavaScript

var $Container = $(".container");

$Container.sortable({
    appendTo: $Container,
    axis: 'x',
    containment: 'parent',
    items: '.sortable-child',
    tolerance: 'intersect',
    update: function() {
        $Container.sortable("cancel");
    }
});