-
Notifications
You must be signed in to change notification settings - Fork 34
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
[Autocomplete-Select] Keep all data in options, and allow to retrieve them in onChange #1448
Comments
@rodolpheV I won't add a second argument on onChange function. But before that, for your problem, I don't see any use case. Could you elaborate a bit more ? |
Then I'll explain my use of this component:
The method
And I would like to do:
|
I guess we can add on option |
@c3dr0x I let you do that one :) |
Current behaviour
The autocomplete select component only keep label and value properties in its options:
edit.js#L153:
data.forEach(item => { options.set(item[keyName], item[labelName]); });
And only the key is given to the onChange:
edit.js#L210:
onChange(key)
As others data properties are only in the store used by the querySearcher, the view has to directly get them here if needed.
Expected behaviour
Keep all data in options:
this.setState({options: data})
, or keep them duplicated in data:this.setState({data})
And allow to retrieve them in onChange:
onChange(key, option)
Versions
Focus-core: 2.1.1
Focus-components: 2.1.7-1
The text was updated successfully, but these errors were encountered: