Prerequisites
Current Behavior
Right now, enableSuggestions is disabled in search-config.js because of a UI bug. If you turn it back on and click an item from your Search History (or a live suggestion), the text box updates, but the actual search never fires. You just get stuck on a blank screen with "0 results".
Expected Behavior
Clicking a dropdown item from your Search History or live suggestions should instantly trigger the search and load the results.
Possible Solution
I dug into the code and it looks like a leftover glitch from the FlexSearch migration:
- The
<Autocomplete> component in Search.js is missing an onChange handler (which fires when you click the dropdown), so it doesn't know an item was selected.
searchHistory isn't being fed into the dropdown options.
- A strict
.includes() check is accidentally blocking history items from firing.
I've already tested a fix locally: wiring up a new handleOptionSelect to the onChange event and merging the options array fixes the dropdown completely and lets us safely turn enableSuggestions back to true.
I'd love your thoughts:
- Does this sound like a solid fix to you?
- If so, I'd be happy to open a PR and get this working again!
Your Environment
- Version used: (Development branch)
- Environment: macOS / Node.js
Prerequisites
Current Behavior
Right now,
enableSuggestionsis disabled insearch-config.jsbecause of a UI bug. If you turn it back on and click an item from your Search History (or a live suggestion), the text box updates, but the actual search never fires. You just get stuck on a blank screen with "0 results".Expected Behavior
Clicking a dropdown item from your Search History or live suggestions should instantly trigger the search and load the results.
Possible Solution
I dug into the code and it looks like a leftover glitch from the FlexSearch migration:
<Autocomplete>component inSearch.jsis missing anonChangehandler (which fires when you click the dropdown), so it doesn't know an item was selected.searchHistoryisn't being fed into the dropdown options..includes()check is accidentally blocking history items from firing.I've already tested a fix locally: wiring up a new
handleOptionSelectto theonChangeevent and merging theoptionsarray fixes the dropdown completely and lets us safely turnenableSuggestionsback totrue.I'd love your thoughts:
Your Environment