Skip to content

Blazor web app (dotnet 8): data-enhance-nav="false" is not working when tag <a/> is wrapping some <svg/> #52205

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

Closed
1 task done
megafetis opened this issue Nov 20, 2023 · 3 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug.
Milestone

Comments

@megafetis
Copy link

megafetis commented Nov 20, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

<a href="/" data-enhance-nav="false"> <svg>...Not refresh page...</svg> </a> - is not working (not refreshing a page. enhance-nav is still enabled)

<a href="/" data-enhance-nav="false"> <img src=""/> </a> - is working (refreshing a page)
This problem is also actual for top level nodes for example ... link with svg ...

Expected Behavior

No response

Steps To Reproduce

jsut create new Blazor Web app and add some code

<a href="/" data-enhance-nav="false">
    <svg xmlns="http://www.w3.org/2000/svg"
     width="467" height="462">
  <rect x="80" y="60" width="250" height="250" rx="20"
      style="fill:#ff0000; stroke:#000000;stroke-width:2px;" />
  
  <rect x="140" y="120" width="250" height="250" rx="40"
      style="fill:#0000ff; stroke:#000000; stroke-width:2px;
      fill-opacity:0.7;" />

  <rect x="140" y="120" width="250" height="250" rx="40"
      style="fill:#00ff00; stroke:#0000cc; stroke-width:5px;
      fill-opacity:1.0;" />
</svg>
</a>

Exceptions (if any)

No response

.NET Version

8

Anything else?

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Nov 20, 2023
@javiercn javiercn added this to the 8.0.x milestone Nov 30, 2023
@javiercn javiercn added the bug This issue describes a behavior which is not expected - a bug. label Nov 30, 2023
@megafetis
Copy link
Author

Update: This bug also happens, when href contains anchor or hash:
<a data-enhance-nav="false" href="/about#licences">About - Licences</a>

@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
@MackinnonBuck
Copy link
Member

Fixed by #53541

@megafetis
Copy link
Author

Cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug.
Projects
Status: Done
Development

No branches or pull requests

4 participants