dnd-kit
dnd-kit copied to clipboard
Vertical Sortable List: wrong height calculation on reorder
Scenario
- Vertical list
- Items of variable height
- Items are Sortable
- Using DragOverlay
Problem
- We have items 1, 2 and 3, they just have texts. Item 2 text is much longer than the other items.
- When reordering item 1 below item 2, the height calculation is wrong
- Item 2 shifts to Item 1 position but instead of using it's actual height, it only occupies Item 1 height
- In some scenarios, this means Item 1 gets hidden behind Item 2 when trying to reorder.
Code Sandbox
https://codesandbox.io/p/sandbox/immutable-sea-55msrd?file=%2Fsrc%2FApp.tsx