File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ class ToolBar extends Component {
3333 componentWillMount ( ) {
3434 const delay = this . props . searchDelayTime ? this . props . searchDelayTime : 0 ;
3535 this . debounceCallback = this . handleDebounce ( ( ) => {
36- this . props . onSearch ( this . refs . seachInput . getValue ( ) ) ;
36+ const { seachInput } = this . refs ;
37+ seachInput && this . props . onSearch ( seachInput . getValue ( ) ) ;
3738 } ,
3839 delay
3940 ) ;
@@ -44,8 +45,9 @@ class ToolBar extends Component {
4445 }
4546
4647 setSearchInput ( text ) {
47- if ( this . refs . seachInput . value !== text ) {
48- this . refs . seachInput . value = text ;
48+ const { seachInput } = this . refs ;
49+ if ( seachInput && seachInput . value !== text ) {
50+ seachInput . value = text ;
4951 }
5052 }
5153
@@ -181,7 +183,8 @@ class ToolBar extends Component {
181183 }
182184
183185 handleClearBtnClick = ( ) => {
184- this . refs . seachInput . setValue ( '' ) ;
186+ const { seachInput } = this . refs ;
187+ seachInput && seachInput . setValue ( '' ) ;
185188 this . props . onSearch ( '' ) ;
186189 }
187190
You can’t perform that action at this time.
0 commit comments