krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
18.15k stars 767 forks source link

Typing a number doesn't show the input value at the top #616

Closed deadcoder0904 closed 2 years ago

deadcoder0904 commented 2 years ago

Describe the bug

I have a Timezone ComboBox where I use Fuse.js. Timezone has values like GMT(+05:30) Asia/Kolkata so when I type 530, it must naturally show it to the top but it doesn't.

It shows other close values.

Version

^6.5.3

🔬Minimal Reproduction

https://codesandbox.io/s/combobox-with-fuse-js-t7u4c?file=/src/App.tsx

Relevant code in the App.tsx file:

const options = {
    keys: ["timezone"]
  };

  const fuse = React.useMemo(() => new Fuse(timezonesList, options), []);
  const filteredItems = React.useMemo(
    () => fuse.search(filterValue).map((tz) => tz.item),
    [filterValue, fuse]
  );

Try typing 530 & it shows other close values but not the main one.

deadcoder0904 commented 2 years ago

I went with https://github.com/ajitid/fzf-for-js & it's working for me with a simple setup but still think this is a bug 👍

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days