mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2026-02-04 10:35:30 +00:00
+BIGFIX: order buttons, collapse inhalte list
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user