react-icons / react-icons

svg react icons of popular icon packs
https://react-icons.github.io/react-icons/
Other
11.25k stars 725 forks source link

[Feature]: Icons Search Issue with Spaces in Query #859

Closed kang-kibong closed 5 months ago

kang-kibong commented 7 months ago

Describe

Searching for icons with spaces in the query does not yield results. This issue was raised once before, but it seems to persist. #796

Solution

const [inputQuery, setInputQuery] = React.useState("");
  const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
    const query = e.target.value;
    setInputQuery(query);
    debouncedOnSearch(query);
  };

In this part, It seems that removing spaces from the user-input query during debouncing could resolve the issue.

Minimal sample repository URL

No response

Additional context

No response