From 369d496bb84971e6dd1195b4ded55d2f62bfa213 Mon Sep 17 00:00:00 2001 From: varjolintu Date: Mon, 18 Jan 2021 07:03:47 +0200 Subject: [PATCH] Fix password generator fill --- keepassxc-browser/content/keepassxc-browser.js | 4 ++-- keepassxc-browser/content/pwgen.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/keepassxc-browser/content/keepassxc-browser.js b/keepassxc-browser/content/keepassxc-browser.js index f6c8709..d02754b 100755 --- a/keepassxc-browser/content/keepassxc-browser.js +++ b/keepassxc-browser/content/keepassxc-browser.js @@ -1417,8 +1417,8 @@ kpxc.setValue = function(field, value) { // Sets a new value to input field and triggers necessary events kpxc.setValueWithChange = function(field, value) { field.value = value; - field.dispatchEvent(new Event('input', { 'bubbles': true })); - field.dispatchEvent(new Event('change', { 'bubbles': true })); + field.dispatchEvent(new Event('input', { bubbles: true })); + field.dispatchEvent(new Event('change', { bubbles: true })); field.dispatchEvent(new KeyboardEvent('keydown', { bubbles: true, cancelable: false, key: '', char: '' })); field.dispatchEvent(new KeyboardEvent('keypress', { bubbles: true, cancelable: false, key: '', char: '' })); field.dispatchEvent(new KeyboardEvent('keyup', { bubbles: true, cancelable: false, key: '', char: '' })); diff --git a/keepassxc-browser/content/pwgen.js b/keepassxc-browser/content/pwgen.js index 623cb53..83f1ea7 100644 --- a/keepassxc-browser/content/pwgen.js +++ b/keepassxc-browser/content/pwgen.js @@ -283,6 +283,8 @@ kpxcPasswordDialog.fill = function(e) { } kpxcPasswordDialog.input.value = password.value; + kpxcPasswordDialog.input.dispatchEvent(new Event('input', { bubbles: true })); + kpxcPasswordDialog.input.dispatchEvent(new Event('change', { bubbles: true })); if (kpxcPasswordDialog.nextField) { kpxcPasswordDialog.nextField.value = password.value;