|
@@ -43,9 +43,9 @@ export default class CustomHeader extends React.Component<Props> {
|
43
|
43
|
};
|
44
|
44
|
|
45
|
45
|
componentDidMount() {
|
46
|
|
- if (this.refs.searchInput !== undefined && this.props.shouldFocusSearchBar) {
|
|
46
|
+ if (this.refs.searchInput !== undefined && this.refs.searchInput._root !== undefined && this.props.shouldFocusSearchBar) {
|
47
|
47
|
// does not work if called to early for some reason...
|
48
|
|
- setInterval(() => this.refs.searchInput._root.focus(), 500);
|
|
48
|
+ setTimeout(() => this.refs.searchInput._root.focus(), 500);
|
49
|
49
|
}
|
50
|
50
|
}
|
51
|
51
|
|