Open m-akinc opened 1 year ago
I'd also like to use routerLinkActive
with nimble-anchor-button (and similar) inside a nimble-toolbar to accomplish a navbar that accents elements as you navigate around our site.
Right now I'm hacking around this problem, but it would nice if it just worked.
Document the workaround/best practice in the Angular section of the Anchor Tab in Storybook (or close as low ROI). Review the discussion in https://github.com/ni/nimble/pull/987 for more info.
π Bug Report
In Angular,
routerLinkActive
is an attribute used to help style an active link element, e.g. the active anchor tab, or the breadcrumb item for the current page. Currently, we use different schemes to style the active item in each of those components. We need to consider integration with therouterLinkActive
attribute.π» Repro or Code Sample
π€ Expected Behavior
When the user activates a tab by clicking or Space/Enter, we should have a way to set the
nimble-anchor-tabs
activeid
to the id of that tab. This could be communicated via an example program, or by a custom directive (e.g.nimbleRouterLinkActive
) that encapsulates that logic.We need to investigate if/how the breadcrumb needs to support
routerLinkActive
in its own way, e.g. clearinghref
on active breadcrumb item.π― Current Behavior
Anchor tabs and breadcrumb don't care about
routerLinkActive
.π Possible Solution
Anchor tabs: Set
activeid
of tabs based onisActive
property ofRouterLinkActive
directives of child anchor tab elements.π¦ Context
Came up in discussion on PR #987