From e29291879362d01f842015357210eb971daf8f30 Mon Sep 17 00:00:00 2001 From: anu Date: Mon, 14 Oct 2024 15:33:46 -0400 Subject: [PATCH] Fixed Tab Key navigation for the sign-in page --- .../components/SignIn/SignInOptionsPanel.jsx | 1 + .../Settings/VoterEmailAddressEntry.jsx | 10 +++++++++- .../Settings/VoterPhoneVerificationEntry.jsx | 17 ++++++++++++++--- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/js/common/components/SignIn/SignInOptionsPanel.jsx b/src/js/common/components/SignIn/SignInOptionsPanel.jsx index 3eef78d1e..070f8dd32 100755 --- a/src/js/common/components/SignIn/SignInOptionsPanel.jsx +++ b/src/js/common/components/SignIn/SignInOptionsPanel.jsx @@ -552,6 +552,7 @@ export default class SignInOptionsPanel extends Component { // hideSignInWithPhoneForm={isCordova()} showAllSignInOptions={this.showAllSignInOptions} showPhoneOnlySignIn={this.showPhoneOnlySignIn} + showEmailOnlySignIn={this.showEmailOnlySignIn} /> {/* {isCordova() && ( */} {/* { @@ -267,6 +271,10 @@ class VoterEmailAddressEntry extends Component { this.props.showAllSignInOptions(); } } + const TermsOfServiceLink = document.getElementById("openTermsOfService"); + if (TermsOfServiceLink) { + TermsOfServiceLink.focus(); + } }; onFocus = () => { diff --git a/src/js/components/Settings/VoterPhoneVerificationEntry.jsx b/src/js/components/Settings/VoterPhoneVerificationEntry.jsx index d6aad7b3c..f5254feee 100644 --- a/src/js/components/Settings/VoterPhoneVerificationEntry.jsx +++ b/src/js/components/Settings/VoterPhoneVerificationEntry.jsx @@ -280,6 +280,10 @@ class VoterPhoneVerificationEntry extends Component { this.setState({ displayPhoneVerificationButton: false, }); + const nextField = document.getElementById("enterVoterEmailAddress") || document.getElementById("openTermsOfService"); + if (nextField) { + nextField.focus(); + } } blurTextFieldAndroid(); }; @@ -306,12 +310,18 @@ class VoterPhoneVerificationEntry extends Component { // WV-316: seperated Cordovoa and Mobile screen cancel logic, Mobile only shows all sign in options on cancel. // if (this.props.showAllSignInOptions) { // this.props.showAllSignInOptions(); - // } + // } } else if (isMobileScreenSize()) { - if (this.props.showAllSignInOptions) { - this.props.showAllSignInOptions(); + if (this.props.showEmailOnlySignIn) { + this.props.showEmailOnlySignIn(); + } + } else { + const nextField = document.getElementById("enterVoterEmailAddress") || document.getElementById("openTermsOfService"); + if (nextField) { + nextField.focus(); } } + }; onFocus = () => { @@ -738,6 +748,7 @@ VoterPhoneVerificationEntry.propTypes = { lockOpenPhoneVerificationButton: PropTypes.bool, showAllSignInOptions: PropTypes.func, showPhoneOnlySignIn: PropTypes.func, + showEmailOnlySignIn: PropTypes.func }; const styles = {