UI - NODEDC TASKMANAGER: сброс выделения kanban-карточки
This commit is contained in:
parent
d7ef3ab050
commit
2224faa8f7
|
|
@ -4,7 +4,7 @@
|
||||||
* See the LICENSE file for details.
|
* 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 { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";
|
import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";
|
||||||
import { dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
import { dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
||||||
|
|
@ -150,6 +150,20 @@ export const BaseKanBanRoot = observer(function BaseKanBanRoot(props: IBaseKanBa
|
||||||
setSelectedIssueId(undefined);
|
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(
|
const canEditProperties = useCallback(
|
||||||
(projectId: string | undefined) => {
|
(projectId: string | undefined) => {
|
||||||
const isEditingAllowedBasedOnProject =
|
const isEditingAllowedBasedOnProject =
|
||||||
|
|
@ -302,6 +316,7 @@ export const BaseKanBanRoot = observer(function BaseKanBanRoot(props: IBaseKanBa
|
||||||
<div
|
<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"}`}
|
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}
|
ref={scrollableContainerRef}
|
||||||
|
onPointerDownCapture={handleKanbanPointerDown}
|
||||||
>
|
>
|
||||||
<div className="relative h-full w-max min-w-full bg-transparent">
|
<div className="relative h-full w-max min-w-full bg-transparent">
|
||||||
<div className="h-full w-max">
|
<div className="h-full w-max">
|
||||||
|
|
|
||||||
|
|
@ -330,6 +330,7 @@ export const KanbanIssueBlock = observer(function KanbanIssueBlock(props: IssueB
|
||||||
{ "z-[100]": isCurrentBlockDragging && cardVariant === "internal-contour" }
|
{ "z-[100]": isCurrentBlockDragging && cardVariant === "internal-contour" }
|
||||||
)}
|
)}
|
||||||
data-card-variant={cardVariant}
|
data-card-variant={cardVariant}
|
||||||
|
data-nodedc-kanban-issue-card="true"
|
||||||
onClick={handleIssueBlockClick}
|
onClick={handleIssueBlockClick}
|
||||||
disabled={!!issue?.tempId}
|
disabled={!!issue?.tempId}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue