Skip to content

Commit 195c67f

Browse files
authored
fix(header): opt logo button out of Angular event replay (#1153)
* fix(header): opt logo button out of Angular event replay Add jsaction="" to the header logo button so pre-hydration clicks are not replayed by Angular's withEventReplay() after hydration. Without this, a click during the SSR loading window could replay onto the logo's routerLink="/", navigating the user to "/" before they interacted. Also removes dead onLogoClick() — the template routes via routerLink directly and never called the method. Fixes LFXV2-2724. Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Andres Tobon <andrest2455@gmail.com> * style(header): apply prettier formatting to logo button Reformatted multi-attribute button element to multi-line per prettier config (line too long after jsaction="" was added). Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Andres Tobon <andrest2455@gmail.com> --------- Signed-off-by: Andres Tobon <andrest2455@gmail.com>
1 parent 8092163 commit 195c67f

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

apps/lfx-one/src/app/shared/components/header/header.component.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@
1616
<i class="fa-light fa-bars text-gray-600 text-xl"></i>
1717
</button>
1818

19-
<button type="button" class="flex items-center space-x-2 hover:opacity-80 transition-opacity p-2" routerLink="/" aria-label="Go to home page">
19+
<button
20+
type="button"
21+
jsaction=""
22+
class="flex items-center space-x-2 hover:opacity-80 transition-opacity p-2"
23+
routerLink="/"
24+
aria-label="Go to home page">
2025
<img src="/images/logo_lfx.svg" alt="LFX Logo" class="w-auto h-5" />
2126
</button>
2227
</div>

apps/lfx-one/src/app/shared/components/header/header.component.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,6 @@ export class HeaderComponent {
117117
this.searchForm.get('search')?.setValue('');
118118
}
119119

120-
protected onLogoClick(): void {
121-
this.router.navigate(['/']);
122-
}
123-
124120
protected onUserClick(): void {
125121
// TODO: Show user menu/dropdown or navigate to profile
126122
console.info('User avatar clicked');

0 commit comments

Comments
 (0)