algolia / algolia/autocomplete
Selecting category does not update results
- Dominant language
- TypeScript
- Stars
- 5.3k
- Forks
- 341
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 5
Description
## Description
When you search for a category in the autocomplete search bar and then select the category the search results do not update according
## Reproduction
[**Preview →**][(https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/playground?file=/app.tsx)](https://codesandbox.io/p/sandbox/github/algolia/autocomplete/tree/next/examples/two-column-layout)
**Steps**
1. Go to sandbox above
2. Start typing a word like 'clothing' in the search bar
3. Click on the category option that appears, should be "T-shirts - Women > Clothing"
4. Results do not update
I'm having the same issue in my local code and I've added an `onSelect` function as well as an emit to app.tsx for `setInstantSearchUiState` but still the results are not updated correctly. I've noticed that selecting any results from `recentSearchesPlugin`,`querySuggestionsPlugin`, or `querySuggestionPluginInCategory` work fine because their code is directly in app.tsx and `setInstantSearchUiState` is called directly in their `onSelect` function.
## Environment
- OS: macOs
- Browser: Chrome
- Autocomplete version: "@algolia/autocomplete-js": "^1.17.8"
Contributor guide
Research direction
Start with the linked playground sandbox and app.tsx, reproduce the category selection using “clothing,” and inspect how its selection path differs from recentSearchesPlugin and querySuggestionsPlugin. Trace the onSelect and emit behavior, then verify that selecting “T-shirts - Women > Clothing” updates the displayed results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100