reactjsdrag-and-dropdnd-kit

react dnd-kit sortable : why is the first element of my sortable not draggable?


I am trying to build a very basic sortable using react dnd-kit, and everything works, except one thing : the first element of my sortable array doesn't move when it is dragged (it moves when other elements are dragged on it, which makes this even weirder).

Hope someone can help me, thanks a lot :)


Solution

  • Ok I solved it, but I'll leave it here just in case it can be useful to someone else.

    The id given to the useSortable hook cannot be 0, and therefore the ids of the list should begin at 1.