Skip to content

Build your personal knowledge base with Trilium Notes

chore(collections/board): fix dragging notes not working

Elian Doran95a392ccfa44
diff --git a/apps/client/src/widgets/collections/board/card.tsx b/apps/client/src/widgets/collections/board/card.tsx
index ca880f77a2..f301a2855d 100644
--- a/apps/client/src/widgets/collections/board/card.tsx
+++ b/apps/client/src/widgets/collections/board/card.tsx
@@ -13,7 +13,6 @@ export default function Card({
branch,
column,
index,
- setDraggedCard,
isDragging
}: {
api: BoardApi,
@@ -21,10 +20,9 @@ export default function Card({
branch: FBranch,
column: string,
index: number,
- setDraggedCard: (card: { noteId: string, branchId: string, fromColumn: string, index: number } | null) => void,
isDragging: boolean
}) {
- const { branchIdToEdit, setBranchIdToEdit } = useContext(BoardViewContext);
+ const { branchIdToEdit, setBranchIdToEdit, setDraggedCard } = useContext(BoardViewContext);
const isEditing = branch.branchId === branchIdToEdit;
const colorClass = note.getColorClass() || '';
const editorRef = useRef<HTMLInputElement>(null);
diff --git a/apps/client/src/widgets/collections/board/column.tsx b/apps/client/src/widgets/collections/board/column.tsx
index d30a6e340a..5a2ed3ad2c 100644
--- a/apps/client/src/widgets/collections/board/column.tsx
+++ b/apps/client/src/widgets/collections/board/column.tsx
@@ -27,11 +27,11 @@ export default function Column({
isDraggingColumn: boolean,
api: BoardApi
} & DragContext) {
- const { columnNameToEdit, setColumnNameToEdit, dropTarget, draggedCard, dropPosition, setDraggedCard} = useContext(BoardViewContext);
+ const { columnNameToEdit, setColumnNameToEdit, dropTarget, draggedCard, dropPosition } = useContext(BoardViewContext);
const isEditing = (columnNameToEdit === column);
const editorRef = useRef<HTMLInputElement>(null);
const { handleColumnDragStart, handleColumnDragEnd, handleDragOver, handleDragLeave, handleDrop } = useDragging({
- column, columnIndex
+ column, columnIndex, columnItems
});
const handleEdit = useCallback(() => {
@@ -95,7 +95,6 @@ export default function Column({
branch={branch}
column={column}
index={index}
- setDraggedCard={setDraggedCard}
isDragging={draggedCard?.noteId === note.noteId}
/>
</>
diff --git a/apps/client/src/widgets/collections/board/index.tsx b/apps/client/src/widgets/collections/board/index.tsx
index e963d00fbf..520817fbd2 100644
--- a/apps/client/src/widgets/collections/board/index.tsx
+++ b/apps/client/src/widgets/collections/board/index.tsx
@@ -61,7 +61,13 @@ export default function BoardView({ note: parentNote, noteIds, viewConfig, saveC
dropPosition, setDropPosition,
draggedCard, setDraggedCard,
dropTarget, setDropTarget
- }), [ branchIdToEdit, columnNameToEdit, setColumnNameToEdit, setBranchIdToEdit ]);
+ }), [ branchIdToEdit, setBranchIdToEdit,
+ columnNameToEdit, setColumnNameToEdit,
+ draggedColumn, setDraggedColumn,
+ dropPosition, setDropPosition,
+ draggedCard, setDraggedCard,
+ dropTarget, setDropTarget
+ ]);
function refresh() {
getBoardData(parentNote, statusAttribute, viewConfig ?? {}).then(({ byColumn, newPersistedData }) => {