Disable contenteditable inputs when read only

This commit is contained in:
Carlos Fernandez 2026-05-26 05:37:47 -04:00
parent e529dd0f88
commit ddc792e9d4
2 changed files with 12 additions and 0 deletions

View file

@ -184,6 +184,9 @@ export default class CharacterSheet extends DHBaseActorSheet {
for (const input of form.querySelectorAll('input:not([type=search]), .editor.prosemirror')) { for (const input of form.querySelectorAll('input:not([type=search]), .editor.prosemirror')) {
input.disabled = disabled; input.disabled = disabled;
} }
for (const element of form.querySelectorAll('.input[contenteditable]')) {
element.classList.toggle('disabled', disabled);
}
} }
/** @inheritDoc */ /** @inheritDoc */

View file

@ -166,6 +166,15 @@ export default class DHBaseActorSheet extends DHApplicationMixin(ActorSheetV2) {
} }
} }
/** Add support for input content editables */
_toggleDisabled(disabled) {
super._toggleDisabled(disabled);
const form = this.form;
for (const element of form.querySelectorAll('.input[contenteditable]')) {
element.classList.toggle('disabled', disabled);
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
/* Context Menu */ /* Context Menu */
/* -------------------------------------------- */ /* -------------------------------------------- */