Repository navigation
fix: IframePreview keeps the previous page's preview after navigation (0.1.16-alpha) - #38
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After navigating within a site, an
<IframePreview>on the next page could show the previous page's live preview, with its Run button hidden.Cause
When the next page has an iframe preview in the same place, Blazor reuses the element and only changes its
data-src.shelldocs.jsset a host up once and marked itdata-loaded, and nothing cleared that, so the old frame stayed loaded and CSS kept hiding the Run button.Fix
shelldocs.jsnow watchesdata-srcanddata-lazyon iframe preview hosts. When either changes, it unloads the frame (about:blank), clearsdata-loadedand sets the host up again for the new page: the Run button comes back forLazy="click", andvisible/nonepreviews load the new page's URL. Sites that worked around this with their ownMutationObserver(ShellUI Native docs) can drop it.Commits
fix(preview): reset an IframePreview reused for another pagechore: bump to 0.1.16-alpha, changelogTesting
?c=URL and hid Run.Lazy="click"frames are cleared and show Run, and Run loads the new page's preview;Lazy="none"frames load the new page's URL; navigating back resets them again.0.1.16-alphapackages.Release
After merging, tag
v0.1.16-alphaonmain.