Merge pull request #1183 from keepassxreboot/fix/password_generator_fill

Fix password generator fill
This commit is contained in:
Sami Vänttinen 2021-01-21 06:17:51 +02:00 committed by GitHub
commit 496a0d603c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -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: '' }));

View file

@ -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;