Repository navigation
fix(sample): size a self-reporting same-origin fitContent demo by its reports only - #194
Merged
Merged
Conversation
… reports only A same-origin fitContent demo was sized by two writers: its own igd-sample-height messages and a direct measurement of its body. When the demo page fills the iframe, the measurement only echoes the iframe height, and an echo that lands after the demo's last report leaves the iframe cut off at a different height on every load. Once a demo reports its size, stop measuring it directly.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The reporting flag persists across iframe navigations, blocking height updates on a subsequent non-reporting page and leaving the iframe at the previous page’s height.
1 open issue
What changed in this PR
This PR addresses #193 by making same-origin fitContent samples use reported dimensions instead of competing direct measurements, preventing reported heights from being overwritten.
Changes:
- Skip direct measurement once a demo reports its size.
- Preserve direct measurement for demos that never report.
- Add regression tests for reporting and non-reporting same-origin demos.
| File | Description |
|---|---|
src/scripts/sample-widget.ts |
Track size reports and skip competing direct measurements; document the behavior. |
scripts/sample-widget.test.mjs |
Test reported-height preservation and direct-measurement fallback. |
Review effort: Balanced
The reporting flag sat on the iframe, so after the iframe navigated from a reporting demo to a same-origin page that does not report, the new page was never measured and kept the previous page's height. Track the reporting document instead.
desig9stein
approved these changes
Nov 12, 2026
ChronosSF
approved these changes
Nov 12, 2026
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
A same-origin
<Sample fitContent>demo was sized two ways at once: by its ownigd-sample-heightmessages, and by a direct measurement of its<body>. When the demo page fills the iframe, that measurement only echoes the iframe height back and cuts the sample off. Once a demo reports its size, the host now uses only the reported size and stops measuring it directly. Demos that never report are still measured as before.Related issue
Closes #193
Related: IgniteUI/igniteui-wc-examples#1317 fixes the demo side, in IgniteUI/igniteui-wc-examples#1318.
Type of change
How to test
npm run test:sample-widget: two new tests cover a same-origin fitContent demo, one that reports its height and one that doesn't. The reporting test fails without this change.Consumer impact
None. The docs pick it up on the next
igniteui-astro-componentsbump.