Skip to content

Commit 7ab2cc4

Browse files
authored
Api proposal fix for NavLink.ShouldMatch (#61151)
* Rename according to the API review. * API declarations update.
1 parent 8645583 commit 7ab2cc4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#nullable enable
2-
virtual Microsoft.AspNetCore.Components.Routing.NavLink.ShouldMatch(string! currentUriAbsolute) -> bool
2+
virtual Microsoft.AspNetCore.Components.Routing.NavLink.ShouldMatch(string! uriAbsolute) -> bool

src/Components/Web/src/Routing/NavLink.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,24 +111,24 @@ private void OnLocationChanged(object? sender, LocationChangedEventArgs args)
111111
/// <summary>
112112
/// Determines whether the current URI should match the link.
113113
/// </summary>
114-
/// <param name="currentUriAbsolute">The absolute URI of the current location.</param>
114+
/// <param name="uriAbsolute">The absolute URI of the current location.</param>
115115
/// <returns>True if the link should be highlighted as active; otherwise, false.</returns>
116-
protected virtual bool ShouldMatch(string currentUriAbsolute)
116+
protected virtual bool ShouldMatch(string uriAbsolute)
117117
{
118118
if (_hrefAbsolute == null)
119119
{
120120
return false;
121121
}
122122

123-
var currentUriAbsoluteSpan = currentUriAbsolute.AsSpan();
123+
var uriAbsoluteSpan = uriAbsolute.AsSpan();
124124
var hrefAbsoluteSpan = _hrefAbsolute.AsSpan();
125-
if (EqualsHrefExactlyOrIfTrailingSlashAdded(currentUriAbsoluteSpan, hrefAbsoluteSpan))
125+
if (EqualsHrefExactlyOrIfTrailingSlashAdded(uriAbsoluteSpan, hrefAbsoluteSpan))
126126
{
127127
return true;
128128
}
129129

130130
if (Match == NavLinkMatch.Prefix
131-
&& IsStrictlyPrefixWithSeparator(currentUriAbsolute, _hrefAbsolute))
131+
&& IsStrictlyPrefixWithSeparator(uriAbsolute, _hrefAbsolute))
132132
{
133133
return true;
134134
}
@@ -138,7 +138,7 @@ protected virtual bool ShouldMatch(string currentUriAbsolute)
138138
return false;
139139
}
140140

141-
var uriWithoutQueryAndFragment = GetUriIgnoreQueryAndFragment(currentUriAbsoluteSpan);
141+
var uriWithoutQueryAndFragment = GetUriIgnoreQueryAndFragment(uriAbsoluteSpan);
142142
if (EqualsHrefExactlyOrIfTrailingSlashAdded(uriWithoutQueryAndFragment, hrefAbsoluteSpan))
143143
{
144144
return true;

0 commit comments

Comments
 (0)