adopted-ember-addons / ember-sortable

Sortable UI primitives for Ember.js
https://ember-sortable.netlify.app/
MIT License
298 stars 148 forks source link

Does not support flex/grid/margin around the sortable-items #473

Open NullVoxPopuli opened 2 years ago

NullVoxPopuli commented 2 years ago

Describe the bug When a layout of items is contained within a flex/grid (with gap), and dragging begins, all items collapse the gap via translateY. This is because this code https://github.com/adopted-ember-addons/ember-sortable/blob/master/addon/modifiers/sortable-group.js#L635-L639 is only calculating translateY from the heights of the surrounding elements, which excludes the gap.

Expected behavior No shift upon drag-start

ghost commented 2 years ago

Is there a workaround until this is fixed? I have this exact problem.

joe-reich commented 1 month ago

I worked around this by adding a margin instead of using flexbox with a gap.