Skip to content

Commit

Permalink
update: searchBar组件focus (#1526)
Browse files Browse the repository at this point in the history
* update: searchBar组件focus

* update: searchBar组件focus
  • Loading branch information
Mr-try authored Sep 27, 2022
1 parent f5cb72d commit 926341b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/taro-ui/src/components/search-bar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ export default class AtSearchBar extends React.Component<
this.props.onActionClick && this.props.onActionClick(event)
}

public UNSAFE_componentWillReceiveProps(nextProps: AtSearchBarProps): void {
if (nextProps.focus !== this.props.focus) {
this.setState({ isFocus: !!nextProps.focus })
}
}

public render(): JSX.Element {
const {
value,
Expand Down

0 comments on commit 926341b

Please sign in to comment.