question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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/router

Description

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:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
atscottcommented, Sep 15, 2021

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:

Hi Andrew, I read the other bug. While I agree to most of the decisions. I want to point out that:

  • It’s okay for multiple items to have aria-selected=true
  • We can introduce this as part of options instead of on by default, which addresses the concerns I think.

β€” You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/angular/angular/issues/29736#issuecomment-920273309, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADVDYNHETRHUBIVMWRO3S3UCDQYFANCNFSM4HD7HDKQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

–

Andrew Scott | Software Engineer | @.*** | 617-394-8788

0reactions
angular-automatic-lock-bot[bot]commented, Oct 16, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found