-
Notifications
You must be signed in to change notification settings - Fork 585
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
Input setState different when onSuggestionSelected using keyboard or mouse #90
Comments
@suite22 Yep, current version has some issues with controlled behaviour. But, hold tight, version 3.0 is on its way. It will support nicely flux architecture (including redux), and you'll be able to differentiate between pressing Enter and mouse click in |
Awesome! Sounds great. Thanks! |
@suite22 Just wanted to let you know that 3.0 alpha version is available on npm:
|
Great! Thanks @moroshko |
My use case might be outside your intended plans for the component, but I want the input to reset to an empty string instead of displaying the selected suggestion. Within onSuggestionSelected I'm using
this.setState({ value: "" })
to reset the input to an empty string. However, that only works if I make the selection using the keyboard. If the user clicks the suggestion the input value remains set to the selected suggestion.I put together a quick example to illustrate the issue - http://codepen.io/suite22/pen/vNPqZX or https://gist.github.com/suite22/981a9c73dc7113d88283
I forked the repo to quickly get the behavior I need 4138bab, but I'm curious if this is expected behavior. I didn't make my change a PR because it does fail several of the asserts related to mouse selection behavior.
The text was updated successfully, but these errors were encountered: