From f2274eaf0f55baa740cb8c18f644f6cc4ebe79de Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Wed, 30 Aug 2023 17:40:43 +0530 Subject: [PATCH 1/2] fix: only left mouse button should trigger all the events --- apps/app/components/gantt-chart/helpers/draggable.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/app/components/gantt-chart/helpers/draggable.tsx b/apps/app/components/gantt-chart/helpers/draggable.tsx index 20423ff5905..8692c905880 100644 --- a/apps/app/components/gantt-chart/helpers/draggable.tsx +++ b/apps/app/components/gantt-chart/helpers/draggable.tsx @@ -73,9 +73,11 @@ export const ChartDraggable: React.FC = ({ }; // handle block resize from the left end - const handleBlockLeftResize = () => { + const handleBlockLeftResize = (e: React.MouseEvent) => { if (!currentViewData || !resizableRef.current || !block.position) return; + if (e.button !== 0) return; + const resizableDiv = resizableRef.current; const columnWidth = currentViewData.data.width; @@ -126,9 +128,11 @@ export const ChartDraggable: React.FC = ({ }; // handle block resize from the right end - const handleBlockRightResize = () => { + const handleBlockRightResize = (e: React.MouseEvent) => { if (!currentViewData || !resizableRef.current || !block.position) return; + if (e.button !== 0) return; + const resizableDiv = resizableRef.current; const columnWidth = currentViewData.data.width; @@ -173,6 +177,8 @@ export const ChartDraggable: React.FC = ({ const handleBlockMove = (e: React.MouseEvent) => { if (!enableBlockMove || !currentViewData || !resizableRef.current || !block.position) return; + if (e.button !== 0) return; + e.preventDefault(); e.stopPropagation(); From 8d98dc9ff4aa201e5b8a7f213e4b31b7e041f708 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Fri, 1 Sep 2023 11:12:48 +0530 Subject: [PATCH 2/2] fix: extra block shadow --- apps/app/components/gantt-chart/helpers/draggable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/app/components/gantt-chart/helpers/draggable.tsx b/apps/app/components/gantt-chart/helpers/draggable.tsx index 8692c905880..b665bf5d3ca 100644 --- a/apps/app/components/gantt-chart/helpers/draggable.tsx +++ b/apps/app/components/gantt-chart/helpers/draggable.tsx @@ -272,7 +272,7 @@ export const ChartDraggable: React.FC = ({