Commit 1dd1fb4f authored by 陈帅's avatar 陈帅

fix code style warring

parent 5b5a737a
...@@ -69,14 +69,14 @@ export default class HeaderSearch extends PureComponent { ...@@ -69,14 +69,14 @@ export default class HeaderSearch extends PureComponent {
}; };
enterSearchMode = () => { enterSearchMode = () => {
const { onVisibleChange } = this.props;
onVisibleChange(true);
this.setState({ searchMode: true }, () => { this.setState({ searchMode: true }, () => {
const { searchMode } = this.state; const { searchMode } = this.state;
if (searchMode) { if (searchMode) {
this.input.focus(); this.input.focus();
} }
}); });
const { onVisibleChange } = this.props;
onVisibleChange(true);
}; };
leaveSearchMode = () => { leaveSearchMode = () => {
...@@ -110,12 +110,10 @@ export default class HeaderSearch extends PureComponent { ...@@ -110,12 +110,10 @@ export default class HeaderSearch extends PureComponent {
className={classNames(className, styles.headerSearch)} className={classNames(className, styles.headerSearch)}
onClick={this.enterSearchMode} onClick={this.enterSearchMode}
onTransitionEnd={({ propertyName }) => { onTransitionEnd={({ propertyName }) => {
if (propertyName === 'width') { if (propertyName === 'width' && !searchMode) {
if (!searchMode) {
const { onVisibleChange } = this.props; const { onVisibleChange } = this.props;
onVisibleChange(searchMode); onVisibleChange(searchMode);
} }
}
}} }}
> >
<Icon type="search" key="Icon" /> <Icon type="search" key="Icon" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment