Skip to content

Build your personal knowledge base with Trilium Notes

chore(collections/board): fix unnecessary repaint

Elian Doran0844f60343d2
diff --git a/apps/client/src/widgets/collections/board/column.tsx b/apps/client/src/widgets/collections/board/column.tsx
index 5d859d9420..cfca7b28fd 100644
--- a/apps/client/src/widgets/collections/board/column.tsx
+++ b/apps/client/src/widgets/collections/board/column.tsx
@@ -147,8 +147,10 @@ function useDragging({ column, columnIndex, columnItems }: DragContext) {
}
}
- setDropPosition({ column, index: newIndex });
- }, [column, setDropTarget, setDropPosition]);
+ if (!(dropPosition?.column === column && dropPosition.index === newIndex)) {
+ setDropPosition({ column, index: newIndex });
+ }
+ }, [column, setDropTarget, dropPosition, setDropPosition]);
const handleDragLeave = useCallback((e: DragEvent) => {
const relatedTarget = e.relatedTarget as HTMLElement;