Fixed UI/UX bug with pressing tab or enter on url input field

This commit is contained in:
James Mills 2020-03-31 21:26:56 +10:00
parent cd574192bf
commit 9bbfb420f9
No known key found for this signature in database
GPG key ID: AC4C014F1440EBD6
2 changed files with 20 additions and 10 deletions

File diff suppressed because one or more lines are too long

View file

@ -75,10 +75,20 @@ const bytesToSize = (bytes) => {
/* MAIN */
document.addEventListener('DOMContentLoaded', () => {
importInput.addEventListener("keyup", (e) => {
if (e.keyCode === 13) {
importInput.addEventListener("keypress", (e) => {
if (e.keyCode == 9) {
urlSelected();
e.preventDefault();
e.stopPropagation();
return;
}
if (e.keyCode === 13 || e.keyCode == 10) {
e.preventDefault();
e.stopPropagation();
urlSelected();
importButton.click();
return;
}
});
}, false)