ComboBoxListItemPicker - onSelectedItem passing data to callback method but with attributes value as 'undefined'
See original GitHub issueCategory
[ ] Enhancement
[X ] Bug
[ ] Question
Version
Please specify what version of the library you are using: [ 1.17.0 ]
Expected
While overriding onSelectedItem method we should get an array of the selected items with Id and Title column.
Below is sample implementation.
<ComboBoxListItemPicker listId='ba682bc2-351e-45ae-8cbe-b0512ba0291a' columnInternalName='Title' keyColumnInternalName='Id' // filter="Title eq 'SPFx'" onSelectedItem={this.onSelectedComboBoxItemPicker} webUrl={this.props.context.pageContext.web.absoluteUrl} spHttpClient={this.props.context.spHttpClient} multiSelect={true} />
private onSelectedComboBoxItemPicker(data: { key: string; name: string }[]) { for (const item of data) { console.log(
Item value: ${item.key}); console.log(
Item text: ${item.name}); } }
Observed Behavior
We are getting Id and Title as undefined in the array. Please refer below screenshot.
Further analysis and a possible fix.
Reference file = webpack:///…/…/…/…/src/controls/listItemPicker/ComboBoxListItemPicker.tsx
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
The documentation has been merged as well.
@AJIXuMuK …thanks…tested this…it is working as expected if we write call back with below syntax
Call back method documented in markup is below, which won’t copy values in key and name unless it is passed in the same format… So I believe we should update the documentation to the above syntax. submitting a PR for same, please merge it if it make sense…!!