Fix active editor height and menu auto sizing

This commit is contained in:
Carlos Fernandez 2026-07-13 04:59:10 -04:00
parent bb2289fa95
commit 3af0dfbe19
2 changed files with 15 additions and 3 deletions

View file

@ -339,9 +339,21 @@ export default class DHBaseItemSheet extends DHApplicationMixin(ItemSheetV2) {
}
}
/**
* Handles the Add GM Note button being pressed. This is only used when an item has no GM notes.
* Later edits to a GM note instead go through the normal editor toggle workflow.
* @this DHBaseItemSheet
*/
static #onEditGMNote() {
// Open the editor, which might be hidden. We remove the css class to hide temporarily
// so that menu auto resizing functions properly.
const editor = this.element.querySelector('prose-mirror[name="system.gmNotes"]');
const wasHidden = editor.classList.contains('hide-if-inactive');
editor.classList.remove('hide-if-inactive');
editor.open = true;
window.setTimeout(() => {
if (wasHidden) editor.classList.add('hide-if-inactive');
}, 0);
}
/** @inheritdoc */

View file

@ -61,12 +61,12 @@
flex: 1 0;
}
&:has(prose-mirror[name="system.gmNotes"]:not(.hide-if-inactive)) {
prose-mirror {
prose-mirror.inactive {
--min-height: 3rem;
&.inactive[name="system.description"] {
&[name="system.description"] {
flex: 0 0;
}
&.inactive[name="system.gmNotes"] {
&[name="system.gmNotes"] {
flex: 1 0;
}
}