Skip to content

Commit d91a700

Browse files
committed
fix(tables): only release the find cursor from the reveal that owns it
1 parent f08db60 commit d91a700

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

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

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,8 +1315,16 @@ export function TableGrid({
13151315
// trusting the check `goToMatch` made before its await.
13161316
if (!isStillAMatch(match)) {
13171317
pendingMatchRef.current = null
1318-
activeMatchRef.current = null
1319-
cursorIsOnMatchRef.current = false
1318+
// Release the cursor only if this reveal still owns it. A pending reveal
1319+
// waits here for its row to load, and the user can start a newer jump in
1320+
// that window — which has already claimed the ref. Clearing it blindly
1321+
// would strand that newer jump with no identity to re-point from, which
1322+
// is the skip-on-next failure this guard exists to prevent.
1323+
const active = activeMatchRef.current
1324+
if (active && active.rowId === match.rowId && active.column === match.column) {
1325+
activeMatchRef.current = null
1326+
cursorIsOnMatchRef.current = false
1327+
}
13201328
return
13211329
}
13221330
const rowIndex = rows.findIndex((r) => r.id === match.rowId)

0 commit comments

Comments
 (0)