Skip to content

fix: IframePreview keeps the previous page's preview after navigation (0.1.16-alpha) - #38

Merged
Shewart merged 2 commits into
mainfrom
fix/iframe-preview-navigation
Oct 14, 2026
Merged

Shewart merged 2 commits into
mainfrom
fix/iframe-preview-navigation

Conversation

@Shewart

@Shewart Shewart commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

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.js set a host up once and marked it data-loaded, and nothing cleared that, so the old frame stayed loaded and CSS kept hiding the Run button.

Fix

shelldocs.js now watches data-src and data-lazy on iframe preview hosts. When either changes, it unloads the frame (about:blank), clears data-loaded and sets the host up again for the new page: the Run button comes back for Lazy="click", and visible / none previews load the new page's URL. Sites that worked around this with their own MutationObserver (ShellUI Native docs) can drop it.

Commits

  • fix(preview): reset an IframePreview reused for another page
  • chore: bump to 0.1.16-alpha, changelog

Testing

  • Reproduced on the example site with two pages that each have iframe previews in the same places: after an in-site navigation the reused frame kept the first page's ?c= URL and hid Run.
  • With the fix, on the same pages and navigation: Blazor still reuses the elements; 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.
  • Release build 0 warnings; 352 tests pass (one new); each commit builds and passes on its own; pack produces the six 0.1.16-alpha packages.

Release

After merging, tag v0.1.16-alpha on main.

@Shewart
Shewart merged commit 48b41d2 into main Oct 14, 2026
1 check passed
@Shewart
Shewart deleted the fix/iframe-preview-navigation branch October 14, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant