I have found a really annoying bug which i can't fix.
Basically if I have a div with fixed width and height and then if I would add one more element to that div content with higher width it would cause a bug where draggable element goes out of its containing element.
I have created a jsFiddle here
To make this bug happen simply drag draggable div to the right side of container and then try dragging it out the container again and it will go out by around 10px, if the process is repeated it can go out as much as you want.
One way I found to if it is by adding overflow hidden to the draggable element, but in my case I need content to be visible no matter what.
JS:
$( "#draggable" ).draggable({
containment: "parent"
});
HTML
<div class="container">
<div id="draggable" class="ui-widget-content">
<p>Drag me around</p>
<div class="footer"></div>
</div>
</div>
CSS
.container{
width:400px;
height: 400px;
border:1px solid red;
}
#draggable{
width: 100px;
height: 200px;
}
.footer{
width: 120%;
height :10px;
background: blue;
}