From 36237263a7d26f3da45fb745c1735afeaacd8790 Mon Sep 17 00:00:00 2001 From: varjolintu Date: Tue, 9 Jul 2019 14:07:25 +0300 Subject: [PATCH] Focus to input field after keyboard fill --- keepassxc-browser/content/keepassxc-browser.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/keepassxc-browser/content/keepassxc-browser.js b/keepassxc-browser/content/keepassxc-browser.js index 03c1669..f0131c2 100755 --- a/keepassxc-browser/content/keepassxc-browser.js +++ b/keepassxc-browser/content/keepassxc-browser.js @@ -1110,7 +1110,13 @@ kpxc.fillInFromActiveElement = function(suppressWarnings, passOnly = false) { const el = document.activeElement; if (el.tagName.toLowerCase() !== 'input') { if (kpxcFields.combinations.length > 0) { - kpxc.fillInCredentials(kpxcFields.combinations[0], false, suppressWarnings); + kpxc.fillInCredentials(kpxcFields.combinations[0], passOnly, suppressWarnings); + + // Focus to the input field + const field = _f(passOnly ? kpxcFields.combinations[0].password : kpxcFields.combinations[0].username); + if (field) { + field.focus(); + } } return; }