forked from github/plane
fix: block click happening while moving (#2275)
This commit is contained in:
parent
2d8cbccfbc
commit
5298f1e53c
@ -179,11 +179,6 @@ export const ChartDraggable: React.FC<Props> = ({
|
|||||||
|
|
||||||
if (e.button !== 0) return;
|
if (e.button !== 0) return;
|
||||||
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
|
|
||||||
setIsMoving(true);
|
|
||||||
|
|
||||||
const resizableDiv = resizableRef.current;
|
const resizableDiv = resizableRef.current;
|
||||||
|
|
||||||
const columnWidth = currentViewData.data.width;
|
const columnWidth = currentViewData.data.width;
|
||||||
@ -193,6 +188,8 @@ export const ChartDraggable: React.FC<Props> = ({
|
|||||||
let initialMarginLeft = parseInt(resizableDiv.style.marginLeft);
|
let initialMarginLeft = parseInt(resizableDiv.style.marginLeft);
|
||||||
|
|
||||||
const handleMouseMove = (e: MouseEvent) => {
|
const handleMouseMove = (e: MouseEvent) => {
|
||||||
|
setIsMoving(true);
|
||||||
|
|
||||||
let delWidth = 0;
|
let delWidth = 0;
|
||||||
|
|
||||||
delWidth = checkScrollEnd(e);
|
delWidth = checkScrollEnd(e);
|
||||||
@ -295,7 +292,9 @@ export const ChartDraggable: React.FC<Props> = ({
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<div
|
<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}
|
onMouseDown={handleBlockMove}
|
||||||
>
|
>
|
||||||
<BlockRender data={block.data} />
|
<BlockRender data={block.data} />
|
||||||
|
Loading…
Reference in New Issue
Block a user