You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
@rodolpheV I won't add a second argument on onChange function.
For input, onChange should take only the value on entry.
Eventually, we could have an option to get the whole value instead of the key.
But before that, for your problem, I don't see any use case. Could you elaborate a bit more ?
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: