|
@@ -20,8 +20,8 @@ class SearchOption extends React.Component {
|
|
|
this.handleClearVal = this.handleClearVal.bind(this);
|
|
|
}
|
|
|
|
|
|
- componentWillReceiveProps(nextProps){
|
|
|
- if(nextProps.visible !== this.props.visible) {
|
|
|
+ /*componentWillReceiveProps(nextProps){
|
|
|
+ if(nextProps.visible != this.props.visible) {
|
|
|
if(!nextProps.visible) {
|
|
|
this.props.handleChangeValue('');
|
|
|
this.textInput.current.value = '';
|
|
@@ -31,8 +31,11 @@ class SearchOption extends React.Component {
|
|
|
this.textInput.current.focus();
|
|
|
}, 0);
|
|
|
}
|
|
|
+ }*/
|
|
|
+ componentDidMount(){
|
|
|
+ this.props.handleChangeValue('');
|
|
|
+ this.textInput.current.focus();
|
|
|
}
|
|
|
-
|
|
|
handleClearVal(){
|
|
|
const { handleChangeValue } = this.props;
|
|
|
this.textInput.current.value = '';
|