Pressing enter when searching prevents results from being displayed
- Dominant language
- TypeScript
- Stars
- 4.4k
- Forks
- 439
- Avg merge
- 14h 32m
- Merged PRs (30d)
- 19
Description
## Description
If a query is typed out and the Enter key is pressed, the UI reports that the query has no results despite the fact that the AJAX request responded with plenty of results.
https://user-images.githubusercontent.com/5017521/198735876-6d6013d1-5a10-45e9-bfe2-d500f67f8fe7.mp4
## Steps to reproduce
1. Open the search input
2. Search for something, typing in the query rapidly and pressing enter when done typing.
3. See the message that there are no results, despite there actually being results that would have been shown had Enter not been pressed after typing.
**Live reproduction:**
Any site that uses docsearch. E.g. https://docsearch.algolia.com/. To reproduce you may need to enable throttling of network requests in developer tools if searches are completing before you can manage to press enter.
## Expected behavior
Pressing Enter triggers the search immediately (same as waiting a short time after stopping typing) but doesn't otherwise break the displaying of results.
## Environment
- OS: [e.g. Windows / Linux / macOS / iOS / Android] Any
- Browser: [e.g. Chrome, Safari] Any
- DocSearch version: [e.g. 3.0.0] 3.3.0
Contributor guide
Research direction
Start by reproducing the search-input behavior in DocSearch 3.3.0 with network throttling, then trace the Enter-key path alongside the normal debounced search. Done means pressing Enter immediately displays the results returned by the AJAX request instead of showing a no-results message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend, search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100