Skip to content

Size embedded content against the view's own box - #773

Merged
oristanovic merged 1 commit into
mainfrom
fix/embedded-zero-height-overflow
Oct 13, 2026
Merged

oristanovic merged 1 commit into
mainfrom
fix/embedded-zero-height-overflow

Conversation

@oristanovic

@oristanovic oristanovic commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

What do these changes do?

An AirshipEmbeddedView that 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 nil to AirshipEmbeddedSize when layout has not supplied a bound, rather than substituting the key window's bounds. And the Fabric host view sets clipsToBounds.

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.

AirshipEmbeddedSize takes optionals, and nil is 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 UIView paints 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:

  • Before: the view paints a roughly 500pt block over the app content above it and pushes the content below it down the screen.
  • After: nothing is covered and the layout is unchanged.

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

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>
@oristanovic
oristanovic requested a review from a team as a code owner October 7, 2026 15:38
@oristanovic
oristanovic merged commit 4cc89d8 into main Oct 13, 2026
1 check passed
@oristanovic
oristanovic deleted the fix/embedded-zero-height-overflow branch October 13, 2026 12:49
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.

2 participants