$('.component-container').sortable({
cursor: 'move',
items: ".component-section",
placeholder: 'ui-state-highlight',
start: function(e, ui) {
ui.placeholder.width(ui.item.find('.component-section').width());
ui.placeholder.height(ui.item.find('.component-section').height());
ui.placeholder.addClass(ui.item.attr("class"));
}
});
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="fila" class="row center expandir component-container" style="text-align: center;">
<div class="col-md-6 col-xs-12" id="firstCol">
<div class="col-md-12 col-sm-12 component-section" id="panel1">
</div>
<div class="col-md-12 col-sm-12 component-section" id="panel3">
</div>
</div>
<div class="col-md-6 col-xs-12" id="secondCol">
<div class="col-md-12 col-sm-12 component-section" id="panel2">
</div>
</div>
</div>
I've implemented drag and drop functionality, but I encountered a bug where it only allows me to drop three divs in the same column and not back into an empty column. How can I modify this to be able to place one of these divs in an empty column?
Thank you