File tree Expand file tree Collapse file tree
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/search-replace Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -390,8 +390,9 @@ export function WorkflowSearchReplace() {
390390 const replaceIndex = afterReplaceIndexRef . current
391391 afterReplaceIndexRef . current = null
392392
393- if ( queryChanged || justOpened ) {
394- // Intentional navigation: panel opened or query changed — go to first match.
393+ if ( queryChanged || justOpened || ! activeMatchId ) {
394+ // Intentional navigation: query changed, panel just opened, or nothing was
395+ // ever selected (e.g. hydration resolved after open with no matches) — go to first match.
395396 handleSelectMatch ( hydratedMatches [ 0 ] . id )
396397 } else if ( replaceIndex !== null ) {
397398 // Replace button was clicked: advance to the match now at the same position (clamped),
You can’t perform that action at this time.
0 commit comments