Skip to content

fix(iOS, SplitView): Override the frame with HostView bounds in collapsed mode#3811

Draft
t0maboro wants to merge 3 commits intomainfrom
@t0maboro/split-view-collapsed-column-resizing
Draft

fix(iOS, SplitView): Override the frame with HostView bounds in collapsed mode#3811
t0maboro wants to merge 3 commits intomainfrom
@t0maboro/split-view-collapsed-column-resizing

Conversation

@t0maboro
Copy link
Copy Markdown
Contributor

@t0maboro t0maboro commented Mar 27, 2026

Description

Navigating back to a supplementary column while the UISplitViewController was collapsed caused the column to render with an incorrect frame. When a UISplitViewController is collapsed, it pushes its columns onto a single UINavigationController stack, but UIKit does not update the frame of off-screen views immediately. Therefore, a hidden supplementary column retains its old width.
If the SplitView is currently collapsed, we know the column must eventually span the entire screen. We extract the Host's bounds and pass them as the target frame directly to the ShadowStateProxy.

Closes: https://github.com/software-mansion/react-native-screens-labs/issues/1089

Changes

  • assigning Host's frame in collapsed mode on ShadowState update

Before & after - visual documentation

Before After
before.mov
after.mov

Test plan

No need to have a dedicated test, reproducible on any existing.

Checklist

  • Included code example that can be used to test this change.
  • Updated / created local changelog entries in relevant test files.
  • For visual changes, included screenshots / GIFs / recordings documenting the change.
  • For API changes, updated relevant public types.
  • Ensured that CI passes

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an iOS UISplitViewController collapsed-mode layout issue where navigating back to an off-screen supplementary column can render with a stale (too narrow) width by overriding the frame used for ShadowTree updates.

Changes:

  • Resolve the SplitHost controller/view via guard and early-return on failure.
  • Compute a targetFrame and, when collapsed, use the host view’s bounds as the intended full-width frame.
  • Pass the computed frame into the ShadowStateProxy update call.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@kligarski kligarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good but I found this bug:

Simulator.Screen.Recording.-.iPad.Pro.13-inch.M5.-.2026-03-31.at.12.00.10.mov

@t0maboro t0maboro marked this pull request as draft April 13, 2026 13:16
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.

3 participants