Skip to content

Commit ad34616

Browse files
waleedlatif1claude
andcommitted
fix(tables): only add real row positions in shift-click range select
Previously the loop added every integer from..to, which in sparse tables (with deleted rows) could add thousands of phantom gap positions. Now iterates positionMap to only add positions with actual rows. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3e51e1c commit ad34616

File tree

1 file changed

+3
-2
lines changed
  • apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,11 @@ export function Table({
539539
if (shiftKey && lastCheckboxRowRef.current !== null) {
540540
const from = Math.min(lastCheckboxRowRef.current, rowIndex)
541541
const to = Math.max(lastCheckboxRowRef.current, rowIndex)
542+
const pMap = positionMapRef.current
542543
setCheckedRows((prev) => {
543544
const next = new Set(prev)
544-
for (let i = from; i <= to; i++) {
545-
next.add(i)
545+
for (const [pos] of pMap) {
546+
if (pos >= from && pos <= to) next.add(pos)
546547
}
547548
return next
548549
})

0 commit comments

Comments
 (0)