Add an option in routerLinkActive directive to add "aria-selected=true" attribute
See original GitHub issueπ feature request
Directive routerLinkActive knows when a link is active. Based on that, add βaria-selected=trueβ attribute to the component.
Relevant Package
This feature request is for @angular/routerDescription
Directive routerLinkActive knows when a link is active. Based on that, add βaria-selected=trueβ attribute to the component.
Describe the solution youβd like
If you have a solution in mind, please describe it.RouterLinkActive already takes routerLinkActiveOptions
as input. We can extend that to support this new feature.
Describe alternatives youβve considered
Have you considered any alternative solutions or workarounds?Alternative is to define my own directive based on routerLinkActive, which I may do in the mean time. But I see this as a core accessibility improvement which should be supported natively.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:5 (4 by maintainers)
Top Results From Across the Web
RouterLinkActive - Angular
Aria -current attribute to apply when the router link is active. ... add the classes only when the URL matches the link exactly,...
Read more >Angular:How to set aria-selected for option in select control for ...
Select options and see that elements are properly postfixed (meaning that aria-selected is set to true). import { Component } from '@angular/Β ...
Read more >Apply a directive when routerLinkActive is true - Google Groups
This is how I add the disabled attribute when the route is active. I suspect your use case can be done the same...
Read more >API Documentation | Vue Router
createRouter( options ): Router ... base? string, optional base to provide. ... Add a navigation guard that triggers whenever the component for the...
Read more >can't bind to 'selected' since it isn't a known property of 'mat ...
To allow any property add 'NOERRORSSCHEMA' to the '@NgModule.schemas' of this component. ("do-checkbox *ngIf="multiple" class="mat-option-pseudo-checkbox" [Β ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I understand that this is slightly different from the other request. That said, this is pretty trivial to implement in another directive with the new isActivechange event on RouterLinkActive rather than increasing the size, complexity, and behavioral responsibilities of the RouterLinkActive. I donβt think thatβs something we should be doing. The directive is nice and focused in its responsibilities at the moment.
On Wed, Sep 15, 2021 at 11:29 AM bm-dev-005 @.***> wrote:
β
Andrew Scott | Software Engineer | @.*** | 617-394-8788
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.