From a5edae2e04acad952b1b29f74328ab1cb9b6c76a Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Wed, 10 Jul 2024 23:59:11 +0600 Subject: [PATCH] fix: todo uncheck --- src/components/CustomRoadmap/FlowRoadmapRenderer.tsx | 5 ++++- src/components/TeamProgress/MemberCustomProgressModal.tsx | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/CustomRoadmap/FlowRoadmapRenderer.tsx b/src/components/CustomRoadmap/FlowRoadmapRenderer.tsx index 3ba55d01b..f64bf7cad 100644 --- a/src/components/CustomRoadmap/FlowRoadmapRenderer.tsx +++ b/src/components/CustomRoadmap/FlowRoadmapRenderer.tsx @@ -62,7 +62,10 @@ export function FlowRoadmapRenderer(props: FlowRoadmapRendererProps) { } const handleTopicRightClick = useCallback((e: MouseEvent, node: Node) => { - const target = e?.currentTarget as HTMLDivElement; + const target = + node?.type === 'todo' + ? document.querySelector(`[data-id="${node.id}"]`) + : (e?.currentTarget as HTMLDivElement); if (!target) { return; } diff --git a/src/components/TeamProgress/MemberCustomProgressModal.tsx b/src/components/TeamProgress/MemberCustomProgressModal.tsx index e2df48032..95f47ffa1 100644 --- a/src/components/TeamProgress/MemberCustomProgressModal.tsx +++ b/src/components/TeamProgress/MemberCustomProgressModal.tsx @@ -161,7 +161,10 @@ export function MemberCustomProgressModal(props: ProgressMapProps) { return; } - const target = e?.currentTarget as HTMLDivElement; + const target = + node?.type === 'todo' + ? document.querySelector(`[data-id="${node.id}"]`) + : (e?.currentTarget as HTMLDivElement); if (!target) { return; } @@ -237,7 +240,6 @@ export function MemberCustomProgressModal(props: ProgressMapProps) {
{