Skip to content

Commit

Permalink
fix: block click happening while moving (#2275)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaryan610 committed Sep 27, 2023
1 parent 2d8cbcc commit 5298f1e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions web/components/gantt-chart/helpers/draggable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,6 @@ export const ChartDraggable: React.FC<Props> = ({

if (e.button !== 0) return;

e.preventDefault();
e.stopPropagation();

setIsMoving(true);

const resizableDiv = resizableRef.current;

const columnWidth = currentViewData.data.width;
Expand All @@ -193,6 +188,8 @@ export const ChartDraggable: React.FC<Props> = ({
let initialMarginLeft = parseInt(resizableDiv.style.marginLeft);

const handleMouseMove = (e: MouseEvent) => {
setIsMoving(true);

let delWidth = 0;

delWidth = checkScrollEnd(e);
Expand Down Expand Up @@ -295,7 +292,9 @@ export const ChartDraggable: React.FC<Props> = ({
</>
)}
<div
className="relative z-[2] rounded h-8 w-full flex items-center"
className={`relative z-[2] rounded h-8 w-full flex items-center ${
isMoving ? "pointer-events-none" : ""
}`}
onMouseDown={handleBlockMove}
>
<BlockRender data={block.data} />
Expand Down

2 comments on commit 5298f1e

@vercel
Copy link

@vercel vercel bot commented on 5298f1e Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

plane-sh-dev – ./space/

plane-sh-dev-git-develop-plane.vercel.app
plane-sh-dev-plane.vercel.app
plane-space-dev.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 5298f1e Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

plane-dev – ./web/

plane-dev-plane.vercel.app
plane-dev.vercel.app
plane-dev-git-develop-plane.vercel.app

Please sign in to comment.