sickdyd / react-search-autocomplete

A search box that filters the provided array of objects
https://sickdyd.github.io/react-search-autocomplete
MIT License
218 stars 82 forks source link

ENTER key gives errror #57

Closed beinoriusju closed 2 years ago

beinoriusju commented 2 years ago

Without typing anything just focusing on component's input and hitting ENTER key gives me an error:

TypeError: results[highlightedItem] is undefined

Component should not assume results is non-emty array.

alamgir8 commented 2 years ago

Hey, I just check with version @6.0.0, and it's working fine, not giving any error now!. I think the problem is with the latest version. You can check with this version : npm i react-search-autocomplete@6.0.0

sickdyd commented 2 years ago

@beinoriusju @alamgir8 Thanks for reporting this, I will look into it over the weekend.

sickdyd commented 2 years ago

@beinoriusju @alamgir8 This problem has been fixed in version 6.1.2, please check it out!