1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-28 23:33:27 +00:00

fix broken skip link focus

This commit is contained in:
Bryan Cunningham
2026-01-16 13:45:00 -05:00
parent 205bb6a829
commit 88fbf7511a
2 changed files with 4 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ import { RouterModule } from "@angular/router";
import { DrawerHostDirective } from "../drawer/drawer-host.directive";
import { DrawerService } from "../drawer/drawer.service";
import { LinkModule } from "../link";
import { LinkComponent, LinkModule } from "../link";
import { SideNavService } from "../navigation/side-nav.service";
import { SharedModule } from "../shared";
@@ -48,11 +48,11 @@ export class LayoutComponent {
*
* @see https://github.com/angular/components/issues/10247#issuecomment-384060265
**/
private readonly skipLink = viewChild.required<ElementRef<HTMLElement>>("skipLink");
private readonly skipLink = viewChild.required<LinkComponent>("skipLink");
handleKeydown(ev: KeyboardEvent) {
if (isNothingFocused()) {
ev.preventDefault();
this.skipLink().nativeElement.focus();
this.skipLink().el.nativeElement.focus();
}
}
}

View File

@@ -96,7 +96,7 @@ const commonStyles = [
},
})
export class LinkComponent {
private el = inject(ElementRef<HTMLElement>);
readonly el = inject(ElementRef<HTMLElement>);
/**
* The variant of link you want to render
* @default "primary"