-
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
get onSuggestionSelected item #458
Comments
As docs suggest, the selected suggestion is available as
|
How to call that i here?
|
You can do it like this. In your react component class, set the function like this. onSuggestionSelected = (event, { suggestion, suggestionValue, suggestionIndex, sectionIndex, method }) =>{
//Here you do whatever you want with the values
alert(suggestionValue); //For example alert the selected value
}; Then when you render your it, call the function. <Autosuggest
suggestions={suggestions}
onSuggestionsFetchRequested={this.onSuggestionsFetchRequested}
onSuggestionsClearRequested={this.onSuggestionsClearRequested}
getSuggestionValue={this.getSuggestionValue}
renderSuggestion={this.renderSuggestion}
onSuggestionSelected={this.onSuggestionSelected}. //. <-----
inputProps={inputProps}
onSuggestionSelected={() => {
console.log('current suggestion')
}}
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can I het onSuggestionSelected current suggestion (json object at that position)? thank you
The text was updated successfully, but these errors were encountered: