Skip to content

Commit e594225

Browse files
committed
Updated trigger
1 parent c45b958 commit e594225

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

CHANGELOG.JSON

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"Added a properties to the `TaxonomyPicker` to specify which terms are disabled/not-selectable [#82](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/82)"
99
],
1010
"fixes": [
11-
"Bug in TaxonomyPicker where values are not updated by an async change [#83](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/83)"
11+
"Bug in `TaxonomyPicker` where values are not updated by an async change [#83](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/83)"
1212
]
1313
},
1414
"contributions": []

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- Added a properties to the `TaxonomyPicker` to specify which terms are disabled/not-selectable [#82](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/82)
88

9+
**Fixes**
10+
11+
- Bug in `TaxonomyPicker` where values are not updated by an async change [#83](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/83)
12+
913
## 1.4.0
1014

1115
**New control(s)**

docs/documentation/docs/about/release-notes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- Added a properties to the `TaxonomyPicker` to specify which terms are disabled/not-selectable [#82](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/82)
88

9+
**Fixes**
10+
11+
- Bug in `TaxonomyPicker` where values are not updated by an async change [#83](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/83)
12+
913
## 1.4.0
1014

1115
**New control(s)**

src/controls/taxonomyPicker/TaxonomyPicker.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { ITaxonomyPickerProps, ITaxonomyPickerState } from './ITaxonomyPicker';
99
import SPTermStorePickerService from './../../services/SPTermStorePickerService';
1010
import { ITermSet, IGroup, ITerm } from './../../services/ISPTermStorePickerService';
1111
import styles from './TaxonomyPicker.module.scss';
12-
import { sortBy, uniqBy, cloneDeep } from '@microsoft/sp-lodash-subset';
12+
import { sortBy, uniqBy, cloneDeep, isEqual } from '@microsoft/sp-lodash-subset';
1313
import TermParent from './TermParent';
1414
import FieldErrorMessage from './ErrorMessage';
1515
import * as appInsights from '../../common/appInsights';
@@ -67,10 +67,12 @@ export class TaxonomyPicker extends React.Component<ITaxonomyPickerProps, ITaxon
6767
/**
6868
* componentWillUpdate lifecycle hook
6969
*/
70-
public componentWillUpdate(nextProps: ITaxonomyPickerProps): void {
71-
this.setState({
72-
activeNodes: nextProps.initialValues || []
73-
});
70+
public componentDidUpdate(prevProps: ITaxonomyPickerProps): void {
71+
if (isEqual(this.props.initialValues, prevProps.initialValues)) {
72+
this.setState({
73+
activeNodes: this.props.initialValues || []
74+
});
75+
}
7476
}
7577

7678
/**

0 commit comments

Comments
 (0)