mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
parent
a9a30e7625
commit
6fcd817e96
2 changed files with 12 additions and 4 deletions
|
|
@ -116,9 +116,9 @@ kpxcForm.getNewPassword = function(passwordInputs = []) {
|
|||
}
|
||||
|
||||
// Choose the last three password fields. The first ones are almost always for something else
|
||||
const current = passwordInputs[passwordInputs.length - 3].value;
|
||||
const newPass = passwordInputs[passwordInputs.length - 2].value;
|
||||
const repeatNew = passwordInputs[passwordInputs.length - 1].value;
|
||||
const current = passwordInputs[passwordInputs.length - 3]?.value;
|
||||
const newPass = passwordInputs[passwordInputs.length - 2]?.value;
|
||||
const repeatNew = passwordInputs[passwordInputs.length - 1]?.value;
|
||||
|
||||
if ((newPass === repeatNew && current !== newPass && current !== repeatNew)
|
||||
|| (current === newPass && repeatNew !== newPass && repeatNew !== current)) {
|
||||
|
|
|
|||
|
|
@ -736,12 +736,20 @@ kpxc.setValue = function(field, value, forced = false) {
|
|||
field.checked = true;
|
||||
}
|
||||
|
||||
// Make sure the input is not wrapped inside another element (custom INPUT element)
|
||||
if (field?.nodeName !== 'INPUT' && field?.nodeName?.includes('INPUT')) {
|
||||
const childInput = field?.querySelector('input');
|
||||
const fieldsFromShadowDOM = kpxcObserverHelper.findInputsFromShadowDOM(field);
|
||||
field = childInput ?? fieldsFromShadowDOM[0];
|
||||
}
|
||||
|
||||
|
||||
kpxc.setValueWithChange(field, value, forced);
|
||||
};
|
||||
|
||||
// Sets a new value to input field and triggers necessary events
|
||||
kpxc.setValueWithChange = function(field, value, forced = false) {
|
||||
if (!forced && field.readOnly) {
|
||||
if (!field || (field?.readOnly && !forced)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue