html5sortable icon indicating copy to clipboard operation
html5sortable copied to clipboard

Help needed "Target Size"

Open AndyPandy123123 opened this issue 7 years ago • 3 comments

How can I change the target size? At the moent im am only able to drop near or on an existing target object.

AndyPandy123123 avatar May 11 '18 12:05 AndyPandy123123

Can you elaborate on what you mean by "target"? You can only drop items within a sortable. If you add padding to the sortable or give it a fixed min-height you should be able to drop it on there.

lukasoppermann avatar May 11 '18 12:05 lukasoppermann

Verfügbare Knöpfe
<ul class="js-sortable-source" id="dragtarget">
my source
</ul>

Aktive Knöpfe
<ul class="js-sortable-target sortable" id="droptarget">
my target
</ul>

Now when I try to drop in the target area I have to drop the items on or near an existing target element. I cant drop underneath an existing target element. That is my issue.

AndyPandy123123 avatar May 11 '18 12:05 AndyPandy123123

Now I get it, this does not work sadly.

It would require us to fire the event when entering the sortable event if it has items and than checking if it is above or below all list items and than adding it accordingly.

The lines that are dealing with it are those: https://github.com/lukasoppermann/html5sortable/blob/master/src/html5sortable.ts#L466-L530

If you are interested in sending in a PR to improve this, I would be very happy.

lukasoppermann avatar May 11 '18 14:05 lukasoppermann