Return early if there are no credentials. This fixes an annoying behavior where the extension selects the contents of a text field that does not contain credentials (e.g. misidentified TOTP field). Selecting the contents of a text field when it is clicked is not normal behavior and feels really off.

This commit is contained in:
Stefan Sundin 2021-11-09 08:10:41 -08:00
parent 7eba997f79
commit b2870c26c0

View file

@ -60,6 +60,12 @@ class Autocomplete {
async showList(inputField) {
this.closeList();
// Return if there are no credentials
if (this.elements.length === 0) {
return;
}
this.input = inputField;
this.input.select();