diff --git a/src/pages/signin/LoginForm.js b/src/pages/signin/LoginForm.js index 25ce38876331..29d8e87ca89d 100755 --- a/src/pages/signin/LoginForm.js +++ b/src/pages/signin/LoginForm.js @@ -58,7 +58,7 @@ class LoginForm extends React.Component { } componentDidMount() { - if (!canFocusInputOnScreenFocus() || !this.input) { + if (!canFocusInputOnScreenFocus() || !this.input || !this.props.isVisible) { return; } this.input.focus(); diff --git a/src/pages/signin/PasswordForm.js b/src/pages/signin/PasswordForm.js index eb51aae76222..5b506ea70f16 100755 --- a/src/pages/signin/PasswordForm.js +++ b/src/pages/signin/PasswordForm.js @@ -18,6 +18,7 @@ import compose from '../../libs/compose'; import TextInput from '../../components/TextInput'; import * as ComponentUtils from '../../libs/ComponentUtils'; import withToggleVisibilityView, {toggleVisibilityViewPropTypes} from '../../components/withToggleVisibilityView'; +import canFocusInputOnScreenFocus from '../../libs/canFocusInputOnScreenFocus'; const propTypes = { /* Onyx Props */ @@ -55,7 +56,7 @@ class PasswordForm extends React.Component { } componentDidMount() { - if (!this.input) { + if (!canFocusInputOnScreenFocus() || !this.input || !this.props.isVisible) { return; } this.input.focus();