From 2cbb7bc4586a7b125d314ab1bd53606794aa9308 Mon Sep 17 00:00:00 2001 From: Stefan Sundin Date: Sun, 7 Nov 2021 12:46:34 -0800 Subject: [PATCH] Do not autofill the password when Tab is pressed if the list has been closed. --- keepassxc-browser/content/autocomplete.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/keepassxc-browser/content/autocomplete.js b/keepassxc-browser/content/autocomplete.js index e382d0c..c2e412a 100644 --- a/keepassxc-browser/content/autocomplete.js +++ b/keepassxc-browser/content/autocomplete.js @@ -200,6 +200,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();