Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

Commit fa6cbcf

Browse files
authored
Update selected state when data is dirty (peacechen#132)
1 parent d7d44af commit fa6cbcf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export default class ModalSelector extends React.Component {
147147
newState.modalVisible = this.props.visible;
148148
doUpdate = true;
149149
}
150-
if(prevProps.selectedKey !== this.props.selectedKey){
150+
if (prevProps.selectedKey !== this.props.selectedKey || prevProps.data !== this.props.data) {
151151
let selectedItem = this.validateSelectedKey(this.props.selectedKey);
152152
newState.selected = selectedItem.label;
153153
newState.changedItem = selectedItem.key;

0 commit comments

Comments
 (0)