-
Notifications
You must be signed in to change notification settings - Fork 382
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
ComboBoxListItemPicker - onSelectedItem passing data to callback method but with attributes value as 'undefined' #519
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
Encountered similar issue and came to same conclusion/resolution as @siddharth-vaghasia. This also seems only applicable to when the multiSelect prop is passed. When not passing multiSelect, no results are returned at all. The value still seems to be returned if I insert a console.log(option) into the above onChanged function, but the else case doesn't return anything as console logging this.selectedItems returns no result, thus line 115 above would likewise result in nothing when you try to filter over it. |
Thank all of you for active discussion! |
@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..!!
|
The documentation has been merged as well. |
Category
[ ] 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!
The text was updated successfully, but these errors were encountered: