Merge pull request #1388 from keepassxreboot/fix/filling_dynamic_popups

Fix filling dynamic popups
This commit is contained in:
Sami Vänttinen 2021-08-05 08:33:32 +03:00 committed by GitHub
commit eeb69820bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 3 deletions

View file

@ -92,6 +92,9 @@ class Autocomplete {
item.addEventListener('mouseover', ev => this.mouseOver(ev, div, item));
item.addEventListener('mouseout', ev => this.mouseOut(ev, item));
item.addEventListener('mousedown', ev => ev.stopPropagation());
item.addEventListener('mouseup', ev => ev.stopPropagation());
div.appendChild(item);
}

View file

@ -6,6 +6,8 @@ CredentialAutocomplete.prototype.click = async function(e, input) {
return;
}
e.stopPropagation();
if (input.value !== '') {
input.select();
}
@ -21,6 +23,8 @@ CredentialAutocomplete.prototype.itemClick = async function(e, item, input, uuid
return;
}
e.stopPropagation();
const index = Array.prototype.indexOf.call(e.currentTarget.parentElement.childNodes, e.currentTarget);
const usernameValue = item.getElementsByTagName('input')[0].value;
await this.fillPassword(usernameValue, index, uuid);

View file

@ -75,10 +75,13 @@ PasswordIcon.prototype.createIcon = function(field) {
return;
}
e.preventDefault();
e.stopPropagation();
kpxcPasswordDialog.showDialog(field, icon);
});
icon.addEventListener('mousedown', ev => ev.stopPropagation());
icon.addEventListener('mouseup', ev => ev.stopPropagation());
kpxcUI.setIconPosition(icon, field, this.rtl);
this.icon = icon;

View file

@ -122,11 +122,14 @@ TOTPFieldIcon.prototype.createIcon = function(field, segmented = false) {
return;
}
e.preventDefault();
e.stopPropagation();
await kpxc.receiveCredentialsIfNecessary();
kpxc.fillFromTOTP(field);
});
icon.addEventListener('mousedown', ev => ev.stopPropagation());
icon.addEventListener('mouseup', ev => ev.stopPropagation());
kpxcUI.setIconPosition(icon, field, this.rtl, segmented);
this.icon = icon;

View file

@ -257,6 +257,8 @@ document.addEventListener('mousemove', function(e) {
return;
}
e.stopPropagation();
if (kpxcPasswordDialog.selected === kpxcPasswordDialog.titleBar) {
const xPos = e.clientX - kpxcPasswordDialog.diffX;
const yPos = e.clientY - kpxcPasswordDialog.diffY;
@ -283,6 +285,7 @@ document.addEventListener('mousedown', function(e) {
return;
}
e.stopPropagation();
kpxcUI.mouseDown = true;
});
@ -291,6 +294,7 @@ document.addEventListener('mouseup', function(e) {
return;
}
e.stopPropagation();
kpxcPasswordDialog.selected = null;
kpxcDefine.selected = null;
kpxcUI.mouseDown = false;

View file

@ -91,10 +91,13 @@ UsernameFieldIcon.prototype.createIcon = function(field) {
return;
}
e.preventDefault();
e.stopPropagation();
iconClicked(field, icon);
});
icon.addEventListener('mousedown', ev => ev.stopPropagation());
icon.addEventListener('mouseup', ev => ev.stopPropagation());
kpxcUI.setIconPosition(icon, field, this.rtl);
this.icon = icon;