Skip to content

Commit

Permalink
Fixes elastic#28154 - Auto focus search bar when page mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
simianhacker committed Feb 21, 2019
1 parent 0ad6345 commit 8683c29
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ export class AutocompleteField extends React.Component<
);
}

public componentDidMount() {
this.inputElement.focus();
}

public componentDidUpdate(prevProps: AutocompleteFieldProps, prevState: AutocompleteFieldState) {
const hasNewValue = prevProps.value !== this.props.value;
const hasNewSuggestions = prevProps.suggestions !== this.props.suggestions;
Expand Down

0 comments on commit 8683c29

Please sign in to comment.