Repository navigation
Size embedded content against the view's own box - #773
Merged
Merged
Conversation
An embedded view that React Native gives no height resolved its percent placement against the full screen instead. The scene then rendered at screen height inside a zero-height box and painted over whatever the app had drawn around it. The size fell back to the key window's bounds whenever the measured width or height was zero. That fallback reads a zero measurement as "unknown", but under Yoga an unsized view really is zero, so the stand-in replaced a real answer rather than filling in a missing one. AirshipEmbeddedSize takes optionals, and nil is the SDK's own signal for "no parent stated" — it then resolves against the SwiftUI proposal, which is the actual box. So pass nil instead of a stand-in. Clip the host view as well. Scene content reports its own size and can exceed the box regardless of what the parent size says, and a UIView paints outside its bounds by default. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
crow
approved these changes
Oct 9, 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.
What do these changes do?
An
AirshipEmbeddedViewthat React Native gives no height now stays inside the box it was given. It used to resolve a percent-height placement against the full screen, render at screen height inside a zero-height box, and paint over the app's own views around it.Two changes. The wrapper passes
niltoAirshipEmbeddedSizewhen layout has not supplied a bound, rather than substituting the key window's bounds. And the Fabric host view setsclipsToBounds.Why are these changes necessary?
The old fallback treated a zero measurement as "size unknown". Under Yoga a view with no height really is zero, so the stand-in was replacing a correct answer, not filling in a missing one.
AirshipEmbeddedSizetakes optionals, andnilis the SDK's signal for "no parent stated" — it then resolves the percentage against the SwiftUI proposal, which is the real box.The clip is separate and still needed: scene content reports its own size and can exceed the box whatever the parent size says, and a
UIViewpaints outside its bounds by default.How did you verify these changes?
In the example app, on a scene whose default placement is
width: 100%, height: 100%, with an embedded view given a width and no height and no clipping ancestor:Built both from the same tree with only these two files differing, against the same scene and channel.
Sized, flex, aspect-ratio and min/max cases were checked at the same time and are unaffected.
Verification Screenshots:
🤖 Generated with Claude Code