Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: search + getOptions bug #107

Closed
davidangel opened this issue Aug 27, 2020 · 10 comments
Closed

Bug: search + getOptions bug #107

davidangel opened this issue Aug 27, 2020 · 10 comments

Comments

@davidangel
Copy link
Contributor

CodeSandbox Reproduction: https://codesandbox.io/s/react-select-search-bug-29g70?file=/src/App.js

When utilizing search and a custom getOptions method, it seems that clicking a result doesn't set the value, but that keyboard navigating with the Enter key does set the value.

@andreymoser
Copy link
Contributor

I am getting the same issue and the Enter event worked for me too, the clicking is not working too.

@maidul98
Copy link

maidul98 commented Sep 4, 2020

Me too, please fix this

@aronedwards91
Copy link

Seems to be an issue from 2.0.4 onward

@tonuegbu
Copy link

Still having this issue. Should I just install an older version?

@tonuegbu
Copy link

@davidangel please what is the solution to this?

@maidul98
Copy link

@davidangel just use https://www.npmjs.com/package/react-select instead. It's better than this so I just switched my thing to that. Easy switch too

@agustingabiola
Copy link

Investigating the onMouseDown trigger the difference is that when you do a search the value of the option is undefined. So when you do send e.target.value down to onSelect it's undefined.

To fix this I set the value manually and still trigger the event for all the other stuff (close on click, ie)

@andreymoser
Copy link
Contributor

I am currently using a beta version (https://github.com/andreymoser/react-select-search/releases/tag/v2.0.6-beta-107) which is working good, it's based on @davidangel 's PR (#108) with minor changes, but I guess we will have to dig up it a lit bit more to have confidence that this fix is good. 🚀

@ivan-kleshnin
Copy link

ivan-kleshnin commented Sep 18, 2020

@maidul98 react-select depends on the big Emotion library. If you care about performance, it's not a good choice.
Unless your app is already styled with Emotion of course.

@tbleckert
Copy link
Owner

Sorry for the delay and thanks @davidangel for the bugfix. I've merged it (just tweaked it a bit to work with numeric values) into master. Can be tested here https://react-select-search.com/?path=/story/async--fetch . Published a patch v2.1.1.

@andreymoser Nice! Let me know if you found anything else that is included in your fixes that I've missed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants