Merge pull request #1438 from stefansundin/tweak-tab-autofill

Do not autofill the password when Tab is pressed if the list is closed
This commit is contained in:
Sami Vänttinen 2021-11-09 19:53:09 +02:00 committed by GitHub
commit e69135ff6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -206,6 +206,11 @@ class Autocomplete {
this.closeList();
}
} else if (e.key === 'Tab') {
// Return if the list is not open
if (items.length === 0) {
return;
}
// Return if value is not in the list
if (inputField.value !== '' && !this.elements.some(c => c.value === inputField.value)) {
this.closeList();