fix(search): prevent stale navigation from clobbering focused search input #41
Reference in New Issue
Block a user
Delete Branch "fix/34-url-synced-input-keystroke-loss"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #34
Summary
qFocusedflag (set viaonfocus/onblur) to the full-text search input on/qassignment in the sync$effectso it only runs while the input is not focuseddata.filters.qwhile the input is focused and asserts the typed value is preservedRoot cause
The
$effectthat syncs URL params → local state ran unconditionally on every navigation. Fast typing triggered agoto()debounce; when the first navigation completed, the effect immediately overwrote the still-focused input with the stale URL value — dropping every character typed during the in-flight request.Test plan
npm run test— all 5 client test files pass, including the new keystroke-preservation testnpm run lint && npm run check— no errors/— no dropped characters or flicker