Skip to content

Bug: Search History & Suggestions show 0 results when clicked #455

Description

@Sumit-ai-dev

Prerequisites

  • Are you running the latest version?
  • Did you check other issues/PRs to see if this has already been reported or requested?

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:

  1. 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.
  2. searchHistory isn't being fed into the dropdown options.
  3. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions