Skip to content

Commit

Permalink
Update selected state when data is dirty (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwoan authored Feb 6, 2020
1 parent d7d44af commit fa6cbcf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default class ModalSelector extends React.Component {
newState.modalVisible = this.props.visible;
doUpdate = true;
}
if(prevProps.selectedKey !== this.props.selectedKey){
if (prevProps.selectedKey !== this.props.selectedKey || prevProps.data !== this.props.data) {
let selectedItem = this.validateSelectedKey(this.props.selectedKey);
newState.selected = selectedItem.label;
newState.changedItem = selectedItem.key;
Expand Down

0 comments on commit fa6cbcf

Please sign in to comment.