messing with scaled drag

Demonstrates a kludgy workaround for one aspect of a bug in jquery affecting dragging with a scale transform in place (https://bugs.jqueryui.com/ticket/6844)

by John Thomson

HTML

<div class='wrapper'>
<div class='dragme'>

</div>
</div>

CSS

.dragme {width: 100px; height: 100px; left: 100px; top:100px; background-color:red; position: absolute;}
.wrapper {transform:scale(0.5);transform-origin:0 0}

JavaScript

$(document).ready(()=>{
   $(".dragme").draggable( {drag: (event, ui) => {
   let scale = 0.5; // replace with whatever the scale actually is
   ui.position.top= ui.position.top / scale;
   ui.position.left= ui.position.left / scale;
   }}); 
});