Skip to content

Commit

Permalink
Reduce vertical vibration on verify code dialog in cordova when advan…
Browse files Browse the repository at this point in the history
…cing to new digit field
  • Loading branch information
SailingSteve committed Dec 14, 2023
1 parent b6c29a9 commit 18b116f
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/js/common/components/Settings/SettingsVerifySecretCode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,25 @@ class SettingsVerifySecretCode extends Component {
const { voterEmailAddress, voterPhoneNumber } = this.props;
// const newVoterPhoneNumber = voterPhoneNumber.replace(/\D+/g, '').replace(/(\d{3})(\d{3})(\d{4})/, '$1-$2-$3');
// console.log('voterEmailAddress:', voterEmailAddress);

let initialDisplay = '';
if (isCordova()) {
const dlg = $('div[class*="SignInModal-dialogPaper"]');
initialDisplay = dlg.css('display');
dlg.css('display', 'none'); // Hide the entry dialog
}

this.setState({
voterEmailAddress,
voterPhoneNumber,
initialDisplay,
});
const delayBeforeClearingVerificationStatus = 200;
this.clearSecretCodeVerificationStatusTimer = setTimeout(() => {
VoterActions.clearSecretCodeVerificationStatus();
}, delayBeforeClearingVerificationStatus);

window.addEventListener('paste', this.onPaste);

if (isCordova()) {
$('#textOrEmailEntryDialog').css('display', 'none'); // Hide the entry dialog
}
}

shouldComponentUpdate (nextProps, nextState) {
Expand Down Expand Up @@ -103,6 +108,10 @@ class SettingsVerifySecretCode extends Component {
}
window.removeEventListener('paste', this.onPaste);
this.closeVerifyModalLocal();
const { initialDisplay = 'unset' } = this.state;
if (isCordova()) {
$('div[class*="SignInModal-dialogPaper"]').css('display', initialDisplay); // un-hide the entry dialog
}
}

handleDigit6Blur = () => {
Expand Down Expand Up @@ -697,7 +706,7 @@ const styles = (theme) => ({
zIndex: '9030 !important',
},
codeVerifyCordova: {
top: '9%',
// top: '9%', Removed 12/13/23 to reduce vertical vibration on digit entry field advance
bottom: 'unset',
height: 'unset',
minHeight: 'unset',
Expand Down

0 comments on commit 18b116f

Please sign in to comment.