From 88fbf7511a38dbc7b1571a5d5b09d16dd6cf1b79 Mon Sep 17 00:00:00 2001 From: Bryan Cunningham Date: Fri, 16 Jan 2026 13:45:00 -0500 Subject: [PATCH] fix broken skip link focus --- libs/components/src/layout/layout.component.ts | 6 +++--- libs/components/src/link/link.component.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/components/src/layout/layout.component.ts b/libs/components/src/layout/layout.component.ts index 7460099cf92..9c18b92b19c 100644 --- a/libs/components/src/layout/layout.component.ts +++ b/libs/components/src/layout/layout.component.ts @@ -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>("skipLink"); + private readonly skipLink = viewChild.required("skipLink"); handleKeydown(ev: KeyboardEvent) { if (isNothingFocused()) { ev.preventDefault(); - this.skipLink().nativeElement.focus(); + this.skipLink().el.nativeElement.focus(); } } } diff --git a/libs/components/src/link/link.component.ts b/libs/components/src/link/link.component.ts index 46080989318..3aea8ae851d 100644 --- a/libs/components/src/link/link.component.ts +++ b/libs/components/src/link/link.component.ts @@ -96,7 +96,7 @@ const commonStyles = [ }, }) export class LinkComponent { - private el = inject(ElementRef); + readonly el = inject(ElementRef); /** * The variant of link you want to render * @default "primary"