diff --git a/src/controls/listItemPicker/ComboBoxListItemPicker.tsx b/src/controls/listItemPicker/ComboBoxListItemPicker.tsx index 8b16a448c..7bad0e27e 100644 --- a/src/controls/listItemPicker/ComboBoxListItemPicker.tsx +++ b/src/controls/listItemPicker/ComboBoxListItemPicker.tsx @@ -104,19 +104,26 @@ export class ComboBoxListItemPicker extends React.Component { - if (option && option.selected) { + private onChanged = (option?: IComboBoxOption, index?: number, value?: string, submitPendingValueEvent?: any): void => { + if(this.props.multiSelect){ + if (option && option.selected) { + this.selectedItems.push({ + [this.props.keyColumnInternalName || "Id"]: option.key, + [this.props.columnInternalName]: option.text, + selected: option.selected + }); + } else { + this.selectedItems = this.selectedItems.filter(o => o[this.props.keyColumnInternalName || "Id"] !== option.key); + } + }else{ this.selectedItems.push({ [this.props.keyColumnInternalName || "Id"]: option.key, - [this.props.columnInternalName]: option.text, - selected: option.selected + [this.props.columnInternalName]: option.text }); - } else { - this.selectedItems = this.selectedItems.filter(o => o[this.props.keyColumnInternalName || "Id"] !== option.key); + + this.selectedItems = this.selectedItems.filter(o => o[this.props.keyColumnInternalName || "Id"] === option.key); } - this.props.onSelectedItem(this.selectedItems.map(item => ({ - [this.props.keyColumnInternalName || "Id"]: item.key, - [this.props.columnInternalName]: item.text - }))); + + this.props.onSelectedItem(this.selectedItems); } } diff --git a/src/controls/listView/ListView.tsx b/src/controls/listView/ListView.tsx index 1a1596890..d8c58ba19 100644 --- a/src/controls/listView/ListView.tsx +++ b/src/controls/listView/ListView.tsx @@ -8,7 +8,7 @@ import * as strings from 'ControlStrings'; import { IGroupsItems } from './IListView'; import * as telemetry from '../../common/telemetry'; import { TextField } from 'office-ui-fabric-react/lib/components/TextField'; -import { filter } from 'lodash'; +import filter = require('lodash/filter'); /** * File type icon component