JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://code.jquery.com/ui/jquery-ui-git.css">
<script src="http://code.jquery.com/ui/jquery-ui-git.js"></script>
<script src="http://rawgithub.com/jquery/jquery-ui/master/tests/jquery.simulate.js"></script>
<div id="container">
<div id="draggable"></div>
</div>
CSS
#container {
width: 200px;
height: 200px;
top: 50px;
left: 50px;
position: absolute;
border: 1px dotted red;
}
#draggable {
width: 50px;
height: 50px;
border: 1px solid black;
}
JavaScript
var d = $('#draggable');
d.draggable({containment: 'parent'});
d.simulate('drag', {dx: 1, dy: 1});
d.draggable('option', 'containment', 'document');
// Now try dragging above or to the left of the container.