[8.0.100-preview.4.23211.1] Anchor tag behavior changed when setting herf="#" in blazor app #47682
Closed
1 task done
Labels
area-blazor
Includes: Blazor, Razor Components
Is there an existing issue for this?
Describe the bug
In dotnet-sdk-8.0.100-preview.4.23211.1, when set herf="#" in blazor page, if user click the link, it will stay on current page. But in previous version, it will navigate to main page.
Application Name: Blazorise
OS: Windows 10 21H2
CPU: X64
.NET Build Number: dotnet-sdk-8.0.100-preview.4.23211.1
App Source checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1799823
Or Github link:
https://github.com/Megabit/Blazorise
Expected Behavior
It navigates to Home page, the url is "https://localhost:5000/#".
Steps To Reproduce
Repro steps:
1.Create a default Blazor Server app with Visual Studio.
2. Add
"<a href="#">Test Link</a>"
on Counter.razor.3. Build the project.
4. Open BlazorApp1.runtimeconfig.json to change the runtime version to let the app run against 8.0.100-preview.4.23211.1:
Actual Result:
It stays on current page, when click the link, the url is "https://localhost:5000/counter#". When mouse hover to the link, it shows https://localhost:5000/# .
Exceptions (if any)
No response
.NET Version
8.0.100-preview.4.23211.1
Anything else?
Findings
In .NET Framework web app, if we add
<a href="#">Test Link</a>
on the page, when click on it, it stays on current page.In 8.0.100-preview.4.23211.1, when mouse hover to the link, it shows https://localhost:5000/# But when click it, it goes to https://localhost:5000/counter#
@dotnet-actwx-bot @dotnet/compat
The text was updated successfully, but these errors were encountered: