Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change email input type to text and trim value before verification #605

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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