You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using routerLink, the blue line above the currently selected item does not get updated when a new item is clicked. This same behaviour can also be seen if you use a click event on an a tag instead of the standard href.
I am using web-components v1.20.2 and angular-components v3.0.2.
Provide Code
<goa-microsite-header[type]="stage"[version]="environment"/><divclass="parent-container"><divstyle="max-width: var(--header-width-max); margin: 0 auto;"><goa-app-headerheading="{{ title }}"url="/"><arouterLink="/">Home</a><goa-app-header-menuheading="Services"><arouterLink="/">Title</a><arouterLink="/">Volume Data Agreement</a></goa-app-header-menu><arouterLink="/">Contact Us</a><a*ngIf="(isLoggedIn$ | async) === false"(click)="signInLocal($event)">Sign In</a></goa-app-header></div></div>
signInLocal(event: any){this.router.navigateByUrl('/',{ state });}
To Reproduce
You may need to update the links in the above code to point to actual locations in your testing app.
With the code provided, click on the "Contact us" link and notice that the indicator doesn't change. Clicking on any of the other items exhibit the same behaviour.
Note that refreshing the page does update the indicator.
What browsers are you seeing the problem on?
Chrome, Edge
Additional context
Changing the attribute from routerLink to href allows the indicator to update on click, but in angular, this will cause the entire page to refresh. This is also seen on our website, using React, so not an Angular only issue, and not necessarily related to routerLink
Additionally, for mobile resolutions, when clicking the Sign In button in the expanded Menu, the drop down doesn't automatically collapse after clicking. It takes me to the page, but the menu stays expanded
The text was updated successfully, but these errors were encountered:
ArakTaiRoth
changed the title
[Bug]: AppHeader not updating current selection when using routerLink
App Header: not updating current selection when using routerLink
May 28, 2024
Describe the bug
When using
routerLink
, the blue line above the currently selected item does not get updated when a new item is clicked. This same behaviour can also be seen if you use a click event on ana
tag instead of the standardhref
.I am using web-components v1.20.2 and angular-components v3.0.2.
Provide Code
To Reproduce
You may need to update the links in the above code to point to actual locations in your testing app.
With the code provided, click on the "Contact us" link and notice that the indicator doesn't change. Clicking on any of the other items exhibit the same behaviour.
Note that refreshing the page does update the indicator.
What browsers are you seeing the problem on?
Chrome, Edge
Additional context
Changing the attribute from
routerLink
tohref
allows the indicator to update on click, but in angular, this will cause the entire page to refresh. This is also seen on our website, using React, so not an Angular only issue, and not necessarily related torouterLink
Additionally, for mobile resolutions, when clicking the
Sign In
button in the expandedMenu
, the drop down doesn't automatically collapse after clicking. It takes me to the page, but the menu stays expandedThe text was updated successfully, but these errors were encountered: