#2092·dnd-kit

Margin left on sortable items behaves strangely

Author: ArnaudBarreCreated Jun 24, 2026Updated Aug 13, 2026
Labelsbugreactdom

Hello !

I'm doing the migration but the new version doesn't handle properly margin-left on the dragged items (when using useSortable at least)

Repro: https://codesandbox.io/p/sandbox/dnd-kit-sandbox-forked-nz4y85?file=%2Fsrc%2FApp.tsx%3A16%2C33 (from a doc example, I just added style={{ marginLeft: 20 }})

In this example obviously you could use a padding on the parent, but in my usecase we have multiple items in the column which are not all aligned, so some of them have a left margin