diff --git a/src/components/TagSelect/index.js b/src/components/TagSelect/index.js index 40c38bc75d9ed2822356df73d931199ee89937bb..e0159aa7d03fa92f61d8c73c99577e23f938b19b 100644 --- a/src/components/TagSelect/index.js +++ b/src/components/TagSelect/index.js @@ -24,7 +24,7 @@ class TagSelect extends Component { value: this.props.value || this.props.defaultValue || [], }; componentWillReceiveProps(nextProps) { - if ('value' in nextProps) { + if ('value' in nextProps && nextProps.value) { this.setState({ value: nextProps.value }); } } @@ -53,7 +53,7 @@ class TagSelect extends Component { const checkedTags = children .filter(child => this.isTagSelectOption(child)) .map(child => child.props.value); - return checkedTags; + return checkedTags || []; } handleTagChange = (value, checked) => {