I have conducted extensive research but have not found a suitable solution for my specific case. Below is the simplified version of my HTML structure:
<div>
<div>
<ul class="sortable">
<li id="item-1">
<!-- item -->
<ul>
<!-- many li tags here with ids like: item-1.1, item-1.2, and so on -->
<ul>
</li>
</ul>
</div>
<div>
<ul class="sortable">
<!-- same structure as above -->
</ul>
</div>
</div>
My goal is to drag "item-1", "item-2," etc., along with all their children simultaneously. However, when dragging "item-1.1" or "item-1.2," they should be moved separately. I attempted using the multisortable jQuery plugin, but encountered an issue where the placeholder had excessive height due to CSS styling:
background-color: rgba(220, 224, 228, .25) !important
height: 150px
margin-bottom: 8px
border-radius: 8px
border: 1px solid $color-border !important
Here is the code snippet I am currently using for sorting:
const sortableOptions = {
connectWith: ".sortable",
cancel: ".ignore-sortable",
placeholder: "ui-state-highlight",
}
$(".sortable").sortable(sortableOptions).disableSelection();
Is there a way to achieve the desired functionality in this scenario?