Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: gantt block getting clicked while moving the block #2275

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading