tbleckert / react-select-search

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

Empty value on click #139

Closed federicocappellotto97 closed 3 years ago

federicocappellotto97 commented 3 years ago

If i click on an option the value of the select is empty. I'm taking options through a fetch <SelectSearch options={[]} getOptions={(query) => { return new Promise((resolve, reject) => { fetch('http://www.omdbapi.com/?s='${query}') .then(response => response.json()) .then(({ Search }) => { resolve(Search.map(({ imdbID, Title }) => ({ value: imdbID, name: Title }))) }) .catch(reject); }); }} search emptyMessage="Nessun film trovato" autoComplete="off" name="movie" placeholder="Aggiungi un film" className="select" />

ezgif-2-1a4f6a189872

federicocappellotto97 commented 3 years ago

I see the same behavior in your examples here

tbleckert commented 3 years ago

Looks like a duplicate of https://github.com/tbleckert/react-select-search/issues/89

federicocappellotto97 commented 3 years ago

Looks like a duplicate of #89

And where is the solution?

tbleckert commented 3 years ago

@federicocappellotto97 In the upcoming v3 release, currently in the next branch. But will probably be patched in v2 as well.

federicocappellotto97 commented 3 years ago

@federicocappellotto97 In the upcoming v3 release, currently in the next branch. But will probably be patched in v2 as well.

Is there any workaround?