tbleckert / react-select-search

⚡️ Lightweight select component for React
https://react-select-search.com
MIT License
676 stars 147 forks source link

Backspace doesn't clear options properly #71

Closed eugenezastrogin closed 4 years ago

eugenezastrogin commented 4 years ago

v1.0.2 does not properly resets option list on backspace before sending it to fuse.

Peek 2020-03-18 19-33

Minimal reproducible case based on live-demo example code: https://stackblitz.com/edit/react-7u9dx3

eugenezastrogin commented 4 years ago

It seems that using FlattenOptions(defaultOptions) instead of flat here partially fixes it, but it might be a crude solution. Still, a good place to start:

https://github.com/tbleckert/react-select-search/blob/e245d9dbc455a721fa8ed458e4f7e277e9717e42/src/useSelect.js#L80

tbleckert commented 4 years ago

Issue has been fixed. See comment in PR for more info