diff --git a/web/components/issues/issue-layouts/kanban/block.tsx b/web/components/issues/issue-layouts/kanban/block.tsx index 195bb09b7..d12e28914 100644 --- a/web/components/issues/issue-layouts/kanban/block.tsx +++ b/web/components/issues/issue-layouts/kanban/block.tsx @@ -124,6 +124,10 @@ export const KanbanIssueBlock: React.FC = memo((props) => { const [isDraggingOverBlock, setIsDraggingOverBlock] = useState(false); const [isCurrentBlockDragging, setIsCurrentBlockDragging] = useState(false); + const canEditIssueProperties = canEditProperties(issue?.project_id); + + const isDragAllowed = !isDragDisabled && !issue?.tempId && canEditIssueProperties; + // Make Issue block both as as Draggable and, // as a DropTarget for other issues being dragged to get the location of drop useEffect(() => { @@ -134,7 +138,7 @@ export const KanbanIssueBlock: React.FC = memo((props) => { return combine( draggable({ element, - canDrag: () => !isDragDisabled, + canDrag: () => isDragAllowed, getInitialData: () => ({ id: issue?.id, type: "ISSUE" }), onDragStart: () => { setIsCurrentBlockDragging(true); @@ -164,15 +168,13 @@ export const KanbanIssueBlock: React.FC = memo((props) => { if (!issue) return null; - const canEditIssueProperties = canEditProperties(issue.project_id); - return ( <>
!isDragDisabled && setIsCurrentBlockDragging(true)} + onDragStart={() => isDragAllowed && setIsCurrentBlockDragging(true)} > = memo((props) => {