mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 18:50:41 +01:00
chore(collections/board): fix dragging notes not working
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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}
|
||||
/>
|
||||
</>
|
||||
|
||||
@@ -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 }) => {
|
||||
|
||||
Reference in New Issue
Block a user