Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change behavior of <a href="#..."></a> #47687

Closed
surayya-MS opened this issue Apr 13, 2023 · 0 comments · Fixed by #47851
Closed

Change behavior of <a href="#..."></a> #47687

surayya-MS opened this issue Apr 13, 2023 · 0 comments · Fixed by #47851
Assignees
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-routing
Milestone

Comments

@surayya-MS
Copy link
Member

surayya-MS commented Apr 13, 2023

Related to #8393 and #47682

Browser recognizes link in the href as a relative path against base url.

Current behavior when clicking <a href="#.."></a> is to scroll to the named element(or element with id) on the current page which is incorrect.

The correct behavior is to navigate to the "{base url}/#.." and then scroll to the element or only scroll if you are already on that page.

Example:
Clinking on <a href="#..."></a> on the "/counter" page now scrolls to the element on same page. It should navigate to "/" and the scroll on "/" page.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Apr 13, 2023
@surayya-MS surayya-MS self-assigned this Apr 13, 2023
@surayya-MS surayya-MS added area-blazor Includes: Blazor, Razor Components feature-routing and removed needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically labels Apr 13, 2023
@surayya-MS surayya-MS added this to the 8.0-preview4 milestone Apr 13, 2023
@surayya-MS surayya-MS added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Apr 14, 2023
@surayya-MS surayya-MS changed the title Anchor tag href="#" shows incorrect link when mouse hover on the link Change behavior of <a href="#..."></a> Apr 24, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-routing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant