Fix using tab with autocomplete

This commit is contained in:
varjolintu 2019-05-10 11:03:16 +03:00
parent d7a49c675e
commit d19bdc0810

View file

@ -167,7 +167,7 @@ kpxcAutocomplete.keyPress = function(e) {
} }
} else if (e.key === 'Tab') { } else if (e.key === 'Tab') {
// Return if value is not in the list // Return if value is not in the list
if (kpxcAutocomplete.input.value !== '' && kpxcAutocomplete.elements.some(c => c.value !== kpxcAutocomplete.input.value)) { if (kpxcAutocomplete.input.value !== '' && !kpxcAutocomplete.elements.some(c => c.value === kpxcAutocomplete.input.value)) {
kpxcAutocomplete.closeList(); kpxcAutocomplete.closeList();
return; return;
} }