JSFiddle - React, Tailwind, and code Playground
HTML
<!-- substitute 1.10.1 with 1.10.3 here below and it doesn't rotate anymore -->
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js" type="text/javascript"></script>
<div>
<div id="bubble" class="bubble">
<div id="wrapper" class="textx">
<div id="pane" class="pane">
<p id="text4534654632432499" class="parag" contentEditable="true">
Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua.
</p>
</div>
</div>
</div>
</div>
CSS
.bubble
{
height: 350px;
width: 350px;
background-color: teal;
border: 1px;
overflow: hidden;
}
.textx
{
background-color:lime;
top: 87px;
left: 87px;
position:relative;
width:145px;
height: 145px;
overflow:hidden;
}
.parag {
color: red;
}
JavaScript
$("#handle").css("visibility", "visible");
// Your original element
var ele = $('#bubble');
$('#bubble').draggable({});
// Create handle dynamically
$('<div></div>').appendTo(ele).attr('id', 'bubblehandle').css({
'position': 'absolute',
'bottom': 15,
'right': 5,
'height': 10,
'width': 10,
'background-color': 'red'
});
ele.css('position', 'relative');
$('#bubblehandle').draggable({
handle: '#bubblehandle',
opacity: 0.01,
helper: 'clone',
drag: function (event, ui) {
var rotateCSS = 'rotate(' + (ui.position.left + ui.position.top) + 'deg)';
$(this).parent().css({
'-moz-transform': rotateCSS,
'-webkit-transform': rotateCSS, '-webkit-backface-visibility': 'hidden',
'-ms-transform': rotateCSS
});
}
});