mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #878 from keepassxreboot/fix/allow_fill_to_readonly_fields
Allow fill to readOnly fields
This commit is contained in:
commit
4e40ad298e
5 changed files with 10 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class PasswordIcon extends Icon {
|
|||
}
|
||||
|
||||
PasswordIcon.prototype.initField = function(field, inputs, pos) {
|
||||
if (!field) {
|
||||
if (!field || field.readOnly) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue