Skip to content

Commit 638527e

Browse files
committed
fix of #722
1 parent b3880e4 commit 638527e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/controls/listItemPicker/ListItemPicker.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,13 @@ export class ListItemPicker extends React.Component<IListItemPickerProps, IListI
8787
private onFilterChanged = async (filterText: string, tagList: { key: string; name: string }[]) => {
8888
let resolvedSugestions: { key: string; name: string }[] = await this.loadListItems(filterText);
8989

90+
const selectedItems = [...this.selectedItems, ...(this.props.defaultSelectedItems || [])];
91+
9092
// Filter out the already retrieved items, so that they cannot be selected again
91-
if (this.selectedItems && this.selectedItems.length > 0) {
93+
if (selectedItems && selectedItems.length > 0) {
9294
let filteredSuggestions = [];
9395
for (const suggestion of resolvedSugestions) {
94-
const exists = this.selectedItems.filter(sItem => sItem.key === suggestion.key);
96+
const exists = selectedItems.filter(sItem => sItem.key === suggestion.key);
9597
if (!exists || exists.length === 0) {
9698
filteredSuggestions.push(suggestion);
9799
}

0 commit comments

Comments
 (0)