feat: Manage downloads and local media

This commit is contained in:
Aleksi Lassila
2024-04-02 20:31:40 +03:00
parent 8a6cfc0669
commit 880b653e8d
23 changed files with 540 additions and 296 deletions

View File

@@ -109,6 +109,7 @@ export class Selectable {
right: undefined
};
private focusByDefault: boolean = false;
private canFocusEmpty: boolean = true;
private trapFocus: boolean = false;
private isInitialized: boolean = false;
private navigationActions: NavigationActions = {};
@@ -213,7 +214,7 @@ export class Selectable {
isFocusable(): boolean {
if (!this.isActive) return false;
if (this.htmlElement) {
if (this.htmlElement && this.canFocusEmpty) {
return this.htmlElement.tabIndex >= 0;
} else {
for (const child of this.children) {
@@ -445,6 +446,11 @@ export class Selectable {
this.trapFocus = trapFocus;
return this;
}
setCanFocusEmpty(canFocusEmpty: boolean) {
this.canFocusEmpty = canFocusEmpty;
return this;
}
}
export function handleKeyboardNavigation(event: KeyboardEvent) {