Skip to content

Commit

Permalink
fix: change email input type to text and trim value before verificati…
Browse files Browse the repository at this point in the history
…on (#605)
  • Loading branch information
dakshpokar authored Nov 22, 2024
1 parent 7427f67 commit 91dc913
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/js/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ class Menu {
</fieldset>
</p>
<p id="email_auth_key_container" class="multi_container">
<input type="email" size="50" id="email_auth_key" aria-label="Enter your email address">
<input type="text" size="50" id="email_auth_key" aria-label="Enter your email address">
<button aria-label="Delete Email Address" title="Delete Email Address" id="delete_email_key" class="invis_button">&times;</button>
<label for="email_authentication">Email Authentication</label>
<button type="button" id="verify">Verify</button>
Expand Down Expand Up @@ -1124,6 +1124,10 @@ class Menu {
document.getElementById('verify'),
'click',
function (e) {
document.getElementById('email_auth_key').value = document
.getElementById('email_auth_key')
.value.trim();

menu.VerifyEmail();
},
]);
Expand Down Expand Up @@ -1268,6 +1272,13 @@ class Menu {
.getElementById('email_auth_key')
.addEventListener('keydown', function (event) {
if (event.key === 'Enter') {
document.getElementById('email_auth_key').value = document
.getElementById('email_auth_key')
.value.trim();

document.getElementById('email_auth_key').selectionStart =
document.getElementById('email_auth_key').value.length;

document.getElementById('verify').click();
}
}),
Expand Down

0 comments on commit 91dc913

Please sign in to comment.