Skip to content

Commit e023057

Browse files
committed
1 parent ffc088a commit e023057

File tree

2 files changed

+27
-15
lines changed

2 files changed

+27
-15
lines changed

package-lock.json

Lines changed: 15 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controls/listItemPicker/ComboBoxListItemPicker.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class ComboBoxListItemPicker extends React.Component<IComboBoxListItemPic
5252
//query += filter;
5353
let keyColumnName = keyColumnInternalName || "Id";
5454

55-
if (!this._options || listId !== this.props.listId) {
55+
if (!this._options || listId !== this.props.listId|| filter !== this.props.filter) {
5656
const listItems = await this._listItemRepo.getListItemsByFilterClause(query,
5757
listId,
5858
columnInternalName,
@@ -61,12 +61,12 @@ export class ComboBoxListItemPicker extends React.Component<IComboBoxListItemPic
6161
itemLimit || 100,
6262
orderBy);
6363

64-
this._options = listItems.map(option => {
65-
return {
66-
key: option[keyColumnName],
67-
text: option[columnInternalName || "Id"]
68-
};
69-
});
64+
this._options = listItems.map(option => {
65+
return {
66+
key: option[keyColumnName],
67+
text: option[columnInternalName || "Id"]
68+
};
69+
});
7070
}
7171

7272
const selectedItems = this._getSelectedItems(props);
@@ -81,12 +81,17 @@ export class ComboBoxListItemPicker extends React.Component<IComboBoxListItemPic
8181
}
8282

8383
public async componentWillReceiveProps(nextProps: IComboBoxListItemPickerProps): Promise<void> {
84+
debugger;
8485
if (nextProps.listId !== this.props.listId) {
8586
this.setState({
8687
selectedItems: [],
8788
});
8889
await this.loadOptions(nextProps, false);
8990
}
91+
if (nextProps.filter !== this.props.filter) {
92+
93+
await this.loadOptions(nextProps, false);
94+
}
9095
if (!isEqual(nextProps.defaultSelectedItems, this.props.defaultSelectedItems)) {
9196
const selectedItems = this._getSelectedItems(nextProps);
9297
this.setState({

0 commit comments

Comments
 (0)