René's URL Explorer Experiment


Title: routerLink directive always makes element focusable · Issue #28345 · angular/angular · GitHub

Open Graph Title: routerLink directive always makes element focusable · Issue #28345 · angular/angular

X Title: routerLink directive always makes element focusable · Issue #28345 · angular/angular

Description: 🐞 bug report Affected Package @angular/router Description Issue #10895 requests that the routerLink-directive should automatically add tabindex on the target element if not already present (implemented via #13094). I understand that this...

Open Graph Description: 🐞 bug report Affected Package @angular/router Description Issue #10895 requests that the routerLink-directive should automatically add tabindex on the target element if not already present (impleme...

X Description: 🐞 bug report Affected Package @angular/router Description Issue #10895 requests that the routerLink-directive should automatically add tabindex on the target element if not already present (impleme...

Opengraph URL: https://github.com/angular/angular/issues/28345

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"routerLink directive always makes element focusable","articleBody":"# 🐞 bug report\r\n\r\n### Affected Package\r\n@angular/router\r\n\r\n### Description\r\n\r\nIssue https://github.com/angular/angular/issues/10895 requests that the `routerLink`-directive should automatically add `tabindex` on the target element if not already present (implemented via https://github.com/angular/angular/pull/13094).\r\n\r\nI understand that this behavior might be convinient in some cases, but it should still be configurable.\r\n\r\nFor example, in order to implement a custom menu widget it's a good practice that the focus always stays on the surrounding element (e.g. `\u003cnav>`) while the user selects the target menu item with the arrow keys.\r\n\r\nRight now, implementing this in a clean and straight-forward way is not possible due to the feature implemented in the issue above. If `\u003ca>` is used for the menu entries, the `href` injected by `routeLink` makes it focusable and even if `\u003cspan>` is used instead, `routeLink` still injects a `tabindex=0` to always make it focusable.\r\nWhen the user then clicks on a link the surrounding `\u003cnav>` element looses its focus as focus moves to the link that has been clicked instead. Even setting `tabindex=\"-1\"` only prevents tabbing to the link but still allows focus via mouse click.\r\n\r\nThere should either be a configuration parameter to prevent setting of `tabindex` or the feature should be reverted as `tabindex` can always be configured manually if necessary.\r\n\r\n## 🔬 Minimal Reproduction\r\n\u003c!--\r\nPlease create and share minimal reproduction of the issue starting with this template: https://stackblitz.com/fork/angular-issue-repro2\r\n-->\r\nhttps://stackblitz.com/edit/angular-issue-repro2-qudebd\r\n\r\n```html\r\n\u003cnav tabindex=\"0\">\r\n  \u003col>\r\n    \u003cli>\r\n      \u003c!-- becomes focusable because of href attribute -->\r\n      \u003ca routerLink=\"bikes\" routerLinkActive=\"active\">Bikes\u003c/a>\r\n    \u003c/li>\r\n    \u003cli>\r\n      \u003c!-- becomes focusable because of tabindex attribute -->\r\n      \u003cspan routerLink=\"cars\" routerLinkActive=\"active\">Cars\u003c/span>\r\n    \u003c/li>\r\n  \u003c/ol>\r\n\u003c/nav>\r\n```\r\n\u003c!--\r\nIf StackBlitz is not suitable for reproduction of your issue, please create a minimal GitHub repository with the reproduction of the issue. Share the link to the repo below along with step-by-step instructions to reproduce the problem, as well as expected and actual behavior.\r\n\r\nIssues that don't have enough info and can't be reproduced will be closed.\r\n\r\nYou can read more about issue submission guidelines here: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-submitting-an-issue\r\n-->\r\n\r\n## 🌍  Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>\r\nAngular CLI: 6.2.9\r\nNode: 8.11.3\r\nOS: darwin x64\r\nAngular: 6.1.10\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... http, language-service, platform-browser\r\n... platform-browser-dynamic, router\r\n\r\nPackage                           Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect         0.8.9\r\n@angular-devkit/build-angular     0.8.9\r\n@angular-devkit/build-optimizer   0.8.9\r\n@angular-devkit/build-webpack     0.8.9\r\n@angular-devkit/core              0.8.9\r\n@angular-devkit/schematics        0.8.9\r\n@angular/cli                      6.2.9\r\n@ngtools/webpack                  6.2.9\r\n@schematics/angular               0.8.9\r\n@schematics/update                0.8.9\r\nrxjs                              6.3.3\r\ntypescript                        2.9.2\r\nwebpack                           4.16.4\r\n\u003c/code>\u003c/pre>\r\n\r\n**Anything else relevant?**\r\n\u003c!-- ✍️Is this a browser specific issue? If so, please specify the browser and version. -->\r\nThis can be reproduced as described in Chrome v71.0.3578.98.\r\nIn Safari the focus is only lost on the second link (i.e. where `\u003cspan>` is used).\r\n\r\n","author":{"url":"https://github.com/akloeber","@type":"Person","name":"akloeber"},"datePublished":"2019-01-24T17:38:01Z","url":"https://github.com/angular/angular/issues/28345"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:72c87556-103d-e428-5de1-6dbbbb6bb79c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idADFE:1087D4:13D34A8:1A7A08F:6B012EB4
html-safe-nonce8bc00d7123abec07f7039435d6739ec9173d8a473b05a5a68f231c0a7ebd945c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBREZFOjEwODdENDoxM0QzNEE4OjFBN0EwOEY6NkIwMTJFQjQiLCJ2aXNpdG9yX2lkIjoiMTY5MjM4MDcwMzEzMzYwOTY1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac228e6a1b3baf5a6acd86fe85e99190141d8fee921871e923eb812e1b148f95aa
hovercard-subject-tagissue:402820115
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/28345/issue_layout
twitter:imagehttps://opengraph.githubassets.com/02a6302d73c13d5d2aabbdf8d80e43e4da950632fae78a9a8b5c80ec913f2dbd/angular/angular/issues/28345
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/02a6302d73c13d5d2aabbdf8d80e43e4da950632fae78a9a8b5c80ec913f2dbd/angular/angular/issues/28345
og:image:alt🐞 bug report Affected Package @angular/router Description Issue #10895 requests that the routerLink-directive should automatically add tabindex on the target element if not already present (impleme...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameakloeber
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/28345#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F28345
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F28345
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/28345
Reloadhttps://github.com/angular/angular/issues/28345
Reloadhttps://github.com/angular/angular/issues/28345
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests141 (141)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/28345
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/28345
#70573https://github.com/angular/angular/pull/70573
routerLink directive always makes element focusablehttps://github.com/angular/angular/issues/28345#top
#70573https://github.com/angular/angular/pull/70573
P4A relatively minor issue that is not relevant to core functionshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P4%22
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
bughttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22bug%22
freq2: mediumhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq2%3A%20medium%22
router: directivesRouterLink, RouterLinkActive, RouterOutlet etc.https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22router%3A%20directives%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/akloeber
akloeberhttps://github.com/akloeber
on Jan 24, 2019https://github.com/angular/angular/issues/28345#issue-402820115
#10895https://github.com/angular/angular/issues/10895
#13094https://github.com/angular/angular/pull/13094
https://stackblitz.com/edit/angular-issue-repro2-qudebdhttps://stackblitz.com/edit/angular-issue-repro2-qudebd
Nexthttps://github.com/angular/angular/issues/28345?timeline_page=1
jasonadenhttps://github.com/jasonaden
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
on Jan 24, 2019https://github.com/angular/angular/issues/28345#event-2095382638
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Jan 24, 2019https://github.com/angular/angular/issues/28345#event-2095382727
jasonadenhttps://github.com/jasonaden
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
open for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22open%20for%20contributions%22
freq2: mediumhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq2%3A%20medium%22
on Jan 24, 2019https://github.com/angular/angular/issues/28345#event-2095884814
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
Backloghttps://github.com/angular/angular/milestone/82
on Jan 24, 2019https://github.com/angular/angular/issues/28345#event-2095884872
https://github.com/alan-mroczek
alan-mroczekhttps://github.com/alan-mroczek
on Jan 29, 2019https://github.com/angular/angular/issues/28345#issuecomment-458404682
@akloeberhttps://github.com/akloeber
https://github.com/akloeber
akloeberhttps://github.com/akloeber
on Jan 29, 2019https://github.com/angular/angular/issues/28345#issuecomment-458443259
@alan-mroczekhttps://github.com/alan-mroczek
https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/How_to_build_custom_form_widgetshttps://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/How_to_build_custom_form_widgets
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_link_rolehttps://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_link_role
https://github.com/alan-mroczek
alan-mroczekhttps://github.com/alan-mroczek
on Jan 29, 2019https://github.com/angular/angular/issues/28345#issuecomment-458489886
@akloeberhttps://github.com/akloeber
#10895https://github.com/angular/angular/issues/10895
@simeylahttps://github.com/simeyla
@gkalpakhttps://github.com/gkalpak
https://github.com/trotyl
trotylhttps://github.com/trotyl
on Jan 30, 2019https://github.com/angular/angular/issues/28345#issuecomment-458915335
#17616https://github.com/angular/angular/issues/17616
https://github.com/nuts-n-bits
nuts-n-bitshttps://github.com/nuts-n-bits
on May 25, 2019https://github.com/angular/angular/issues/28345#issuecomment-495872526
https://github.com/willyboy
willyboyhttps://github.com/willyboy
on Jul 22, 2019https://github.com/angular/angular/issues/28345#issuecomment-513811234
@alan-mroczekhttps://github.com/alan-mroczek
https://github.com/nuts-n-bits
nuts-n-bitshttps://github.com/nuts-n-bits
on Jul 22, 2019https://github.com/angular/angular/issues/28345#issuecomment-513819918
https://github.com/willyboy
willyboyhttps://github.com/willyboy
on Jul 23, 2019https://github.com/angular/angular/issues/28345#issuecomment-514352745
@nuts-n-bitshttps://github.com/nuts-n-bits
https://github.com/HafizAhmedMoon
HafizAhmedMoonhttps://github.com/HafizAhmedMoon
on Nov 2, 2022https://github.com/angular/angular/issues/28345#issuecomment-1300252311
https://github.com/pix27
pix27https://github.com/pix27
on Dec 1, 2022https://github.com/angular/angular/issues/28345#issuecomment-1333818997
https://github.com/RooftopTal
RooftopTalhttps://github.com/RooftopTal
on Jun 21, 2023https://github.com/angular/angular/issues/28345#issuecomment-1600633077
https://github.com/bjmc
bjmchttps://github.com/bjmc
on Aug 10, 2023https://github.com/angular/angular/issues/28345#issuecomment-1673488370
@pix27https://github.com/pix27
https://github.com/CrashBrennan
CrashBrennanhttps://github.com/CrashBrennan
on Jul 30, 2024https://github.com/angular/angular/issues/28345#issuecomment-2259174221
github-merge-queuehttps://github.com/apps/github-merge-queue
on Aug 8, 2024https://github.com/angular/angular/issues/28345#event-13808447187
fix(angular): remove the tabindex set by routerLink from Ionic compon…https://github.com/ionic-team/ionic-framework/commit/20073e10c934d3704734195c72f4281c9b9658e3
20073e1https://github.com/ionic-team/ionic-framework/commit/20073e10c934d3704734195c72f4281c9b9658e3
https://github.com/laurenzfiala
laurenzfialahttps://github.com/laurenzfiala
on Aug 28, 2024https://github.com/angular/angular/issues/28345#issuecomment-2314756911
https://open-ui.org/components/focusgroup.explainer/https://open-ui.org/components/focusgroup.explainer/
https://github.com/Da13Harris
Da13Harrishttps://github.com/Da13Harris
on Oct 15, 2024https://github.com/angular/angular/issues/28345#issuecomment-2414842394
https://github.com/davidenke
davidenkehttps://github.com/davidenke
on Mar 14, 2025https://github.com/angular/angular/issues/28345#issuecomment-2723972676
arturovthttps://github.com/arturovt
on Sep 4, 2026https://github.com/angular/angular/issues/28345#event-30570351253
fix(router): stop adding tabindex to non-anchor elements with routerLinkhttps://github.com/arturovt/angular/commit/8e90c732ac6b9f15443987e203834dbe4a2eebe4
https://docs.github.com/articles/closing-issues-via-commit-messages
8e90c73https://github.com/arturovt/angular/commit/8e90c732ac6b9f15443987e203834dbe4a2eebe4
fix(router): stop adding tabindex to non-anchor elements with routerLinkhttps://github.com/arturovt/angular/commit/d5ff5047f73c2f876bb578829d105bd6cfdacee3
https://docs.github.com/articles/closing-issues-via-commit-messages
d5ff504https://github.com/arturovt/angular/commit/d5ff5047f73c2f876bb578829d105bd6cfdacee3
fix(router): stop adding tabindex to non-anchor elements with routerLinkhttps://github.com/arturovt/angular/commit/858d62a68a78adb3139c297a472a51060d630e98
https://docs.github.com/articles/closing-issues-via-commit-messages
858d62ahttps://github.com/arturovt/angular/commit/858d62a68a78adb3139c297a472a51060d630e98
arturovthttps://github.com/arturovt
on Sep 22, 2026https://github.com/angular/angular/issues/28345#event-31596041157
fix(router): stop adding tabindex to non-anchor elements with routerLinkhttps://github.com/arturovt/angular/commit/ec182f8e73f527bb625eb1ac9891525a20f3b2aa
https://docs.github.com/articles/closing-issues-via-commit-messages
ec182f8https://github.com/arturovt/angular/commit/ec182f8e73f527bb625eb1ac9891525a20f3b2aa
atscotthttps://github.com/atscott
on Sep 22, 2026https://github.com/angular/angular/issues/28345#event-31620264326
fix(router): stop adding tabindex to non-anchor elements with routerLinkhttps://github.com/arturovt/angular/commit/33ac75ecac13504cdf62c21c370790db04361a6e
https://docs.github.com/articles/closing-issues-via-commit-messages
33ac75ehttps://github.com/arturovt/angular/commit/33ac75ecac13504cdf62c21c370790db04361a6e
arturovthttps://github.com/arturovt
on Oct 1, 2026https://github.com/angular/angular/issues/28345#event-32288524249
fix(router): stop adding tabindex to non-anchor elements with routerLinkhttps://github.com/arturovt/angular/commit/cbdd707fbbf699521d5746066fdf2f1b680d7127
https://docs.github.com/articles/closing-issues-via-commit-messages
cbdd707https://github.com/arturovt/angular/commit/cbdd707fbbf699521d5746066fdf2f1b680d7127
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/28345
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/28345
P4A relatively minor issue that is not relevant to core functionshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P4%22
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
bughttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22bug%22
freq2: mediumhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq2%3A%20medium%22
router: directivesRouterLink, RouterLinkActive, RouterOutlet etc.https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22router%3A%20directives%22
BacklogNo due datehttps://github.com/angular/angular/milestone/82
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.