Merge pull request #878 from keepassxreboot/fix/allow_fill_to_readonly_fields

Allow fill to readOnly fields
This commit is contained in:
Sami Vänttinen 2020-06-14 15:10:11 +03:00 committed by GitHub
commit 4e40ad298e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 5 deletions

View file

@ -10,6 +10,10 @@ kpxcAutocomplete.shadowRoot = undefined;
kpxcAutocomplete.wrapper = undefined;
kpxcAutocomplete.create = function(input, showListInstantly = false, autoSubmit = false) {
if (input.readOnly) {
return;
}
kpxcAutocomplete.autoSubmit = autoSubmit;
kpxcAutocomplete.input = input;
kpxcAutocomplete.started = true;
@ -238,7 +242,6 @@ kpxcAutocomplete.updatePosition = function(inputField, elem) {
div.style.top = Pixels(rect.top + document.scrollingElement.scrollTop + inputField.offsetHeight);
div.style.left = Pixels(rect.left + document.scrollingElement.scrollLeft);
}
};
// Detect click outside autocomplete

View file

@ -705,7 +705,7 @@ kpxcObserverHelper.getInputs = function(target) {
// Filter out any input fields with type 'hidden' right away
const inputFields = [];
Array.from(target.getElementsByTagName('input')).forEach(e => {
if (e.type !== 'hidden' && !e.readOnly) {
if (e.type !== 'hidden') {
inputFields.push(e);
}
});

View file

@ -24,7 +24,7 @@ class PasswordIcon extends Icon {
}
PasswordIcon.prototype.initField = function(field, inputs, pos) {
if (!field) {
if (!field || field.readOnly) {
return;
}

View file

@ -42,7 +42,8 @@ TOTPFieldIcon.prototype.initField = function(field, forced) {
|| field.size < 2
|| (field.maxLength > 0 && (field.maxLength < 6 || field.maxLength > 8))
|| field.id.match(ignoreRegex)
|| field.name.match(ignoreRegex)) {
|| field.name.match(ignoreRegex)
|| field.readOnly) {
return;
}
} else {

View file

@ -39,7 +39,8 @@ UsernameFieldIcon.prototype.initField = function(field) {
|| field.getAttribute('kpxc-username-field') === 'true'
|| field.getAttribute('kpxc-totp-field') === 'true'
|| (field.hasAttribute('kpxc-defined') && field.getAttribute('kpxc-defined') !== 'username')
|| !kpxcFields.isVisible(field)) {
|| !kpxcFields.isVisible(field)
|| field.readOnly) {
return;
}