From 1dd1fb4f682f7c8f699e0b160da0a2036c102b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Wed, 12 Sep 2018 12:25:07 +0800 Subject: [PATCH] fix code style warring --- src/components/HeaderSearch/index.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/HeaderSearch/index.js b/src/components/HeaderSearch/index.js index dbcabbc9..95d946c0 100644 --- a/src/components/HeaderSearch/index.js +++ b/src/components/HeaderSearch/index.js @@ -69,14 +69,14 @@ export default class HeaderSearch extends PureComponent { }; enterSearchMode = () => { + const { onVisibleChange } = this.props; + onVisibleChange(true); this.setState({ searchMode: true }, () => { const { searchMode } = this.state; if (searchMode) { this.input.focus(); } }); - const { onVisibleChange } = this.props; - onVisibleChange(true); }; leaveSearchMode = () => { @@ -110,11 +110,9 @@ export default class HeaderSearch extends PureComponent { className={classNames(className, styles.headerSearch)} onClick={this.enterSearchMode} onTransitionEnd={({ propertyName }) => { - if (propertyName === 'width') { - if (!searchMode) { - const { onVisibleChange } = this.props; - onVisibleChange(searchMode); - } + if (propertyName === 'width' && !searchMode) { + const { onVisibleChange } = this.props; + onVisibleChange(searchMode); } }} > -- GitLab