Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonix1 <40320097+lonix1@users.noreply.github.com>2022-11-09 02:05:36 +0300
committerGitHub <noreply@github.com>2022-11-09 02:05:36 +0300
commit97e9592a60b3bafcc6091d54d8faba4e57dd6200 (patch)
treef04cddc1f00fc35cc018081590f63ea501b1937d
parente609b1cad60e431ddc0c187e14c537eb4221c1a2 (diff)
refactor(NavLink): render aria-current attribute (#44913)
-rw-r--r--src/Components/Web/src/Routing/NavLink.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Components/Web/src/Routing/NavLink.cs b/src/Components/Web/src/Routing/NavLink.cs
index 3e2d96c81e..8ab139754b 100644
--- a/src/Components/Web/src/Routing/NavLink.cs
+++ b/src/Components/Web/src/Routing/NavLink.cs
@@ -163,7 +163,11 @@ public class NavLink : ComponentBase, IDisposable
builder.AddMultipleAttributes(1, AdditionalAttributes);
builder.AddAttribute(2, "class", CssClass);
- builder.AddContent(3, ChildContent);
+ if (_isActive)
+ {
+ builder.AddAttribute(3, "aria-current", "page");
+ }
+ builder.AddContent(4, ChildContent);
builder.CloseElement();
}