UI - NODEDC TASKMANAGER: сброс выделения kanban-карточки

This commit is contained in:
DCCONSTRUCTIONS 2026-05-11 12:57:10 +03:00
parent d7ef3ab050
commit 2224faa8f7
2 changed files with 17 additions and 1 deletions

View File

@ -4,7 +4,7 @@
* See the LICENSE file for details.
*/
import type { FC } from "react";
import type { FC, PointerEvent } from "react";
import { useCallback, useEffect, useRef, useState } from "react";
import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";
import { dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
@ -150,6 +150,20 @@ export const BaseKanBanRoot = observer(function BaseKanBanRoot(props: IBaseKanBa
setSelectedIssueId(undefined);
}, []);
const handleKanbanPointerDown = useCallback(
(event: PointerEvent<HTMLDivElement>) => {
if (!selectedIssueId) return;
const target = event.target;
if (!(target instanceof Element)) return;
if (target.closest("[data-nodedc-kanban-issue-card='true']")) return;
handleClearSelectedIssue();
},
[handleClearSelectedIssue, selectedIssueId]
);
const canEditProperties = useCallback(
(projectId: string | undefined) => {
const isEditingAllowedBasedOnProject =
@ -302,6 +316,7 @@ export const BaseKanBanRoot = observer(function BaseKanBanRoot(props: IBaseKanBa
<div
className={`nodedc-kanban-scroll-container horizontal-scrollbar relative flex scrollbar-lg h-full w-full bg-transparent ${sub_group_by ? "vertical-scrollbar overflow-y-auto" : "overflow-x-auto overflow-y-hidden"}`}
ref={scrollableContainerRef}
onPointerDownCapture={handleKanbanPointerDown}
>
<div className="relative h-full w-max min-w-full bg-transparent">
<div className="h-full w-max">

View File

@ -330,6 +330,7 @@ export const KanbanIssueBlock = observer(function KanbanIssueBlock(props: IssueB
{ "z-[100]": isCurrentBlockDragging && cardVariant === "internal-contour" }
)}
data-card-variant={cardVariant}
data-nodedc-kanban-issue-card="true"
onClick={handleIssueBlockClick}
disabled={!!issue?.tempId}
>