+BIGFIX: order buttons, collapse inhalte list

This commit is contained in:
Simon Martens
2026-01-16 18:15:59 +01:00
parent 8c96aaa88b
commit 136cb5f757
9 changed files with 201 additions and 42 deletions

View File

@@ -278,6 +278,10 @@ export class DivManager extends HTMLElement {
}, 10);
}
}
requestAnimationFrame(() => {
this._focusFirstField(child.node);
});
}
renderMenu() {
@@ -373,4 +377,27 @@ export class DivManager extends HTMLElement {
}
});
}
_focusFirstField(container) {
if (!container) {
return;
}
const focusables = container.querySelectorAll(
"input:not([type='hidden']):not([disabled]), textarea:not([disabled]), select:not([disabled]), [contenteditable='true'], trix-editor",
);
for (const field of focusables) {
if (!(field instanceof HTMLElement)) {
continue;
}
if (field.getClientRects().length === 0) {
continue;
}
try {
field.focus({ preventScroll: true });
} catch {
field.focus();
}
return;
}
}
}