Open rhodon-jargon opened 1 year ago
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Is there an existing issue for this?
Describe the bug
When a link (
<a>
tag) is clicked within aniframe
but its target is the parent frame (the one running blazor), it is treated as external navigation (e.g. blazor has to reload) even if itshref
is within the base tag. I have already tried multiple ways to fix this, like setting thetarget
to_top
or_parent
, or adding a<base>
tag to the iframe (with the samehref
as the parent's<base>
tag, and/or with atarget
of_top
or_parent
instead of the<a>
tag). I understand this might not be possible to prevent when theiframe
is a different origin, but the bug also occurs when setting the contents of theiframe
using thesrcdoc
attribute. I have only tested this in Blazor Webassembly, though I suspect Blazor Server works the same way.Expected Behavior
When an internal link is clicked within the iframe, the internal router of blazor handles the redirection without reloading if possible.
Steps To Reproduce
Create an
iframe
with thesrcdoc
set to<a href="/some-internal-link">Click</a>
. Clicking the link reloads the page. I also made a sample project based on the Webassembly template: FrameNavigation. The problem can be seen on the Counter page.Exceptions (if any)
No response
.NET Version
7.0.202
Anything else?
Context: I am using an iframe to isolate (trusted) user content from the main layout, so that the user can supply custom CSS and HTML without affecting the main page. However, the user content should be able to link to other user content/pages.