feito fork de vergnet/application-amicale
fixed focus repeating every 500ms
Esse commit está contido em:
pai
ab7e8f92fc
commit
4cb0d2f8b5
1 arquivos alterados com 2 adições e 2 exclusões
|
@ -43,9 +43,9 @@ export default class CustomHeader extends React.Component<Props> {
|
|||
};
|
||||
|
||||
componentDidMount() {
|
||||
if (this.refs.searchInput !== undefined && this.props.shouldFocusSearchBar) {
|
||||
if (this.refs.searchInput !== undefined && this.refs.searchInput._root !== undefined && this.props.shouldFocusSearchBar) {
|
||||
// does not work if called to early for some reason...
|
||||
setInterval(() => this.refs.searchInput._root.focus(), 500);
|
||||
setTimeout(() => this.refs.searchInput._root.focus(), 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Carregando…
Referência em uma nova issue