I have been trying to get jQuery UI's draggable/droppable to work properly with round elements, but it seems that all of the methods I've tried make elements visually round, but they are still treated like squares.
The specific issue I am having is when using a droppable with a border-radius or clip-path, the draggable can be dropped on the "corners" that should not be there...
To better illustrate my issue:
<div class="droppable"></div>
<div class="draggable"></div>
.droppable {
position:relative;
background:green;
height:200px;
width:200px;
border-radius: 50%;
}
.draggable {
background:black;
height: 25px;
width: 25px;
}
.touched {
background:red;
}
$('.draggable').draggable();
$('.droppable').droppable({
tolerance: 'touch',
over: function () {
$(this).addClass('touched');
}
});
<svg width="0" height="0">
<clipPath id="clipping">
<circle cx="100" cy="100" r="100" />
</clipPath>
</svg>
.droppable {
position:relative;
background:green;
width:200px;
height:200px;
clip-path: url(#clipping);
}
I have dug through the API Documentation for both Draggable and Droppable and I've searched for other ways to create circular/round elements, hence clip-path, but haven't been able to come up with a work-around.
Is there any way to get draggable and droppable to treat round elements like round elements?