thisbeyond / solid-dnd

A lightweight, performant, extensible drag and drop toolkit for Solid JS.
https://solid-dnd.com
MIT License
505 stars 35 forks source link

fix transforming sortable items #114

Open yonathan06 opened 3 months ago

yonathan06 commented 3 months ago

I experienced an issue where sortable items with different heights were not transformed properly The issue was that the delta was calculated as target.x - current.x (or target.y - current.y) the delta was the diff between an item and the one before/after them, instead of the size of the dragged item Changed it to transform based on the size of the dragged item

here is a reproduction repo https://stackblitz.com/edit/solidjs-templates-atuhev