Skip to content

Commit

Permalink
Merge pull request #4110 from anup2307/Fix-Wv-547-TabKeyNavigation
Browse files Browse the repository at this point in the history
[WV-547] Fixed Tab Key navigation for the sign-in page [Team Review]
  • Loading branch information
DaleMcGrew authored Oct 16, 2024
2 parents f172d26 + e292918 commit 84466d8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/js/common/components/SignIn/SignInOptionsPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ export default class SignInOptionsPanel extends Component {
// hideSignInWithPhoneForm={isCordova()}
showAllSignInOptions={this.showAllSignInOptions}
showPhoneOnlySignIn={this.showPhoneOnlySignIn}
showEmailOnlySignIn={this.showEmailOnlySignIn}
/>
{/* {isCordova() && ( */}
{/* <VoterPhoneEmailCordovaEntryModal */}
Expand Down
10 changes: 9 additions & 1 deletion src/js/components/Settings/VoterEmailAddressEntry.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,12 @@ class VoterEmailAddressEntry extends Component {
this.setState({
displayEmailVerificationButton: false,
});
const TermsOfServiceLink = document.getElementById("openTermsOfService");
if (TermsOfServiceLink) {
TermsOfServiceLink.focus();
}
blurTextFieldAndroid();
}
}
};

onCancel = () => {
Expand All @@ -267,6 +271,10 @@ class VoterEmailAddressEntry extends Component {
this.props.showAllSignInOptions();
}
}
const TermsOfServiceLink = document.getElementById("openTermsOfService");
if (TermsOfServiceLink) {
TermsOfServiceLink.focus();
}
};

onFocus = () => {
Expand Down
17 changes: 14 additions & 3 deletions src/js/components/Settings/VoterPhoneVerificationEntry.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};
Expand All @@ -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 = () => {
Expand Down Expand Up @@ -738,6 +748,7 @@ VoterPhoneVerificationEntry.propTypes = {
lockOpenPhoneVerificationButton: PropTypes.bool,
showAllSignInOptions: PropTypes.func,
showPhoneOnlySignIn: PropTypes.func,
showEmailOnlySignIn: PropTypes.func
};

const styles = {
Expand Down

0 comments on commit 84466d8

Please sign in to comment.