Skip to content

Commit 8eb28da

Browse files
waleedlatif1claude
andcommitted
fix(tables): clear isColumnSelection on double-click and right-click, skip scroll for column select
- Clear isColumnSelection when double-clicking a cell to edit, preventing the column selection effect from fighting with the editing state - Clear isColumnSelection when right-clicking outside the current selection, preventing stale column selection from re-expanding - Skip scroll-into-view when isColumnSelection is true, preventing the viewport from jumping to the bottom row when clicking a column header Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 46df490 commit 8eb28da

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table/table.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ export function Table({
624624
if (!isWithinSelection) {
625625
setSelectionAnchor({ rowIndex, colIndex })
626626
setSelectionFocus(null)
627+
setIsColumnSelection(false)
627628
}
628629
}
629630
}
@@ -904,6 +905,7 @@ export function Table({
904905
}, [])
905906

906907
useEffect(() => {
908+
if (isColumnSelection) return
907909
const target = selectionFocus ?? selectionAnchor
908910
if (!target) return
909911
const { rowIndex, colIndex } = target
@@ -914,7 +916,7 @@ export function Table({
914916
cell?.scrollIntoView({ block: 'nearest', inline: 'nearest' })
915917
})
916918
return () => cancelAnimationFrame(rafId)
917-
}, [selectionAnchor, selectionFocus])
919+
}, [selectionAnchor, selectionFocus, isColumnSelection])
918920

919921
const handleCellClick = useCallback((rowId: string, columnName: string) => {
920922
const column = columnsRef.current.find((c) => c.name === columnName)
@@ -939,6 +941,7 @@ export function Table({
939941
if (!column || column.type === 'boolean') return
940942

941943
setSelectionFocus(null)
944+
setIsColumnSelection(false)
942945
setEditingCell({ rowId, columnName })
943946
setInitialCharacter(null)
944947
}, [])

0 commit comments

Comments
 (0)