diff --git a/apps/client/src/ee/base/components/grid/grid-cell.tsx b/apps/client/src/ee/base/components/grid/grid-cell.tsx index f587909f4..f54687428 100644 --- a/apps/client/src/ee/base/components/grid/grid-cell.tsx +++ b/apps/client/src/ee/base/components/grid/grid-cell.tsx @@ -76,6 +76,7 @@ export const GridCell = memo(function GridCell({ const tapStartRef = useRef<{ x: number; y: number } | null>(null); const suppressClickRef = useRef(false); + const expandClickGuardRef = useRef(false); const handleDoubleClick = useCallback(() => { if (!property || isRowNumber) return; @@ -121,6 +122,7 @@ export const GridCell = memo(function GridCell({ const handlePointerDown = useCallback( (e: React.PointerEvent) => { + expandClickGuardRef.current = false; if (e.pointerType === "mouse") return; suppressClickRef.current = false; tapStartRef.current = { x: e.clientX, y: e.clientY }; @@ -140,11 +142,18 @@ export const GridCell = memo(function GridCell({ ) { return; } - if ((e.target as HTMLElement).closest("button, a, input")) return; + const target = e.target as HTMLElement; + if (onExpandRow && target.closest("[data-base-row-expand]")) { + suppressClickRef.current = true; + expandClickGuardRef.current = true; + onExpandRow(rowId); + return; + } + if (target.closest("button, a, input")) return; suppressClickRef.current = true; handleDoubleClick(); }, - [handleDoubleClick], + [handleDoubleClick, onExpandRow, rowId], ); const handlePointerCancel = useCallback(() => { @@ -262,8 +271,15 @@ export const GridCell = memo(function GridCell({