feat: Rework login page & appState initialization

This commit is contained in:
Aleksi Lassila
2024-04-09 21:20:23 +03:00
parent b5e7e4deff
commit 914e9faccc
11 changed files with 162 additions and 83 deletions

View File

@@ -13,7 +13,7 @@ export type NavigationActions = {
};
type FocusEventOptions = {
setFocusedElement: boolean;
setFocusedElement: boolean | HTMLElement;
propagate: boolean;
onFocus?: (
superOnFocus: FocusHandler,
@@ -146,7 +146,11 @@ export class Selectable {
propagateFocusUpdates(_options, this);
if (_options.setFocusedElement) {
this.htmlElement.focus({ preventScroll: true });
if (_options.setFocusedElement === true) {
this.htmlElement.focus({ preventScroll: true });
} else {
_options.setFocusedElement.focus({ preventScroll: true });
}
Selectable.focusedObject.set(this);
}
}