dnd-kit
dnd-kit copied to clipboard
sortable: check over change before calling strategy
useSortable
should check if over
has change before calling strategy
.
https://github.com/clauderic/dnd-kit/blob/master/packages/sortable/src/hooks/useSortable.ts#L84
Currently, strategy
is called for every rerender of DndContext
.
Can you elaborate on why this is a problem for your use-case?
If I am not mistaken.
Currently, DndContext is rerendered on every drag move event. https://github.com/clauderic/dnd-kit/blob/master/packages/core/src/components/DndContext/DndContext.tsx#L359
But not every move event causes overId
to change, i.e. over event is less frequent than move event.
https://github.com/clauderic/dnd-kit/blob/master/packages/core/src/components/DndContext/DndContext.tsx#L278
If over event does not happen, then there is no need to recalculate transformation of droppable containers.
any update @clauderic ?