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,
|
branch,
|
||||||
column,
|
column,
|
||||||
index,
|
index,
|
||||||
setDraggedCard,
|
|
||||||
isDragging
|
isDragging
|
||||||
}: {
|
}: {
|
||||||
api: BoardApi,
|
api: BoardApi,
|
||||||
@@ -21,10 +20,9 @@ export default function Card({
|
|||||||
branch: FBranch,
|
branch: FBranch,
|
||||||
column: string,
|
column: string,
|
||||||
index: number,
|
index: number,
|
||||||
setDraggedCard: (card: { noteId: string, branchId: string, fromColumn: string, index: number } | null) => void,
|
|
||||||
isDragging: boolean
|
isDragging: boolean
|
||||||
}) {
|
}) {
|
||||||
const { branchIdToEdit, setBranchIdToEdit } = useContext(BoardViewContext);
|
const { branchIdToEdit, setBranchIdToEdit, setDraggedCard } = useContext(BoardViewContext);
|
||||||
const isEditing = branch.branchId === branchIdToEdit;
|
const isEditing = branch.branchId === branchIdToEdit;
|
||||||
const colorClass = note.getColorClass() || '';
|
const colorClass = note.getColorClass() || '';
|
||||||
const editorRef = useRef<HTMLInputElement>(null);
|
const editorRef = useRef<HTMLInputElement>(null);
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ export default function Column({
|
|||||||
isDraggingColumn: boolean,
|
isDraggingColumn: boolean,
|
||||||
api: BoardApi
|
api: BoardApi
|
||||||
} & DragContext) {
|
} & DragContext) {
|
||||||
const { columnNameToEdit, setColumnNameToEdit, dropTarget, draggedCard, dropPosition, setDraggedCard} = useContext(BoardViewContext);
|
const { columnNameToEdit, setColumnNameToEdit, dropTarget, draggedCard, dropPosition } = useContext(BoardViewContext);
|
||||||
const isEditing = (columnNameToEdit === column);
|
const isEditing = (columnNameToEdit === column);
|
||||||
const editorRef = useRef<HTMLInputElement>(null);
|
const editorRef = useRef<HTMLInputElement>(null);
|
||||||
const { handleColumnDragStart, handleColumnDragEnd, handleDragOver, handleDragLeave, handleDrop } = useDragging({
|
const { handleColumnDragStart, handleColumnDragEnd, handleDragOver, handleDragLeave, handleDrop } = useDragging({
|
||||||
column, columnIndex
|
column, columnIndex, columnItems
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleEdit = useCallback(() => {
|
const handleEdit = useCallback(() => {
|
||||||
@@ -95,7 +95,6 @@ export default function Column({
|
|||||||
branch={branch}
|
branch={branch}
|
||||||
column={column}
|
column={column}
|
||||||
index={index}
|
index={index}
|
||||||
setDraggedCard={setDraggedCard}
|
|
||||||
isDragging={draggedCard?.noteId === note.noteId}
|
isDragging={draggedCard?.noteId === note.noteId}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -61,7 +61,13 @@ export default function BoardView({ note: parentNote, noteIds, viewConfig, saveC
|
|||||||
dropPosition, setDropPosition,
|
dropPosition, setDropPosition,
|
||||||
draggedCard, setDraggedCard,
|
draggedCard, setDraggedCard,
|
||||||
dropTarget, setDropTarget
|
dropTarget, setDropTarget
|
||||||
}), [ branchIdToEdit, columnNameToEdit, setColumnNameToEdit, setBranchIdToEdit ]);
|
}), [ branchIdToEdit, setBranchIdToEdit,
|
||||||
|
columnNameToEdit, setColumnNameToEdit,
|
||||||
|
draggedColumn, setDraggedColumn,
|
||||||
|
dropPosition, setDropPosition,
|
||||||
|
draggedCard, setDraggedCard,
|
||||||
|
dropTarget, setDropTarget
|
||||||
|
]);
|
||||||
|
|
||||||
function refresh() {
|
function refresh() {
|
||||||
getBoardData(parentNote, statusAttribute, viewConfig ?? {}).then(({ byColumn, newPersistedData }) => {
|
getBoardData(parentNote, statusAttribute, viewConfig ?? {}).then(({ byColumn, newPersistedData }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user