Skip to content

Commit 2d526d7

Browse files
samejrclaude
andcommitted
fix(webapp): sync search input on blur after URL change during focus
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6571201 commit 2d526d7

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

apps/webapp/app/components/primitives/SearchInput.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ export function SearchInput({
6060
}
6161
const urlSearch = value(paramName) ?? "";
6262
if (urlSearch === lastSyncedRef.current) return;
63-
lastSyncedRef.current = urlSearch;
64-
if (!isFocused) setText(urlSearch);
63+
// Only mark synced once we actually apply it, so a URL change during focus still syncs on blur.
64+
if (!isFocused) {
65+
lastSyncedRef.current = urlSearch;
66+
setText(urlSearch);
67+
}
6568
}, [isControlled, controlledValue, value, isFocused, paramName]);
6669

6770
const updateText = (next: string) => {

0 commit comments

Comments
 (0)