Repository navigation
Conversation
`RNTesterTabsIOSComponentView` installed its `UITabBarController`'s view as its content view when it was created, so the view entered the window with the component, and the controller became a child of the view controller above only afterwards, in `didMoveToWindow`. UIKit's containment rules ask for the opposite order. On a physical iPhone Duo with iOS 27.2, launched unfolded, RNTester sometimes came up with no tab items until it was sent to the background and back. A likely cause is that the tab bar was laid out once by a controller with no parent and again once it had one. That mechanism is inferred, not confirmed. Install the view only while the controller is a child, in the order UIKit documents for container view controllers: `didMoveToWindow` adds the controller to the view controller above, sizes and installs its view, then calls `didMoveToParentViewController:`, and reverses that when the component leaves the window. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
RNTester's iOS tabs computed their content insets only when the selected tab's safe area changed, from the tab bar's frame at that moment. The safe area can change before the tab bar controller's layout pass moves the bar, so the insets described the bar's previous position. After an unfolded iPhone Duo turned to portrait, where its side tab bar moves to the bottom, the bottom inset stayed 0 and the list ran under the bar, where taps switch tabs. Also compute the insets after each layout pass of the tab bar controller, which a `UITabBarController` subclass reports from `viewDidLayoutSubviews`, and read the safe area at that time instead of taking it from the callback. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This branch has not been deployed
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:
Stacked on #60368 ("Contain RNTester's tab bar controller before its view enters a window"), which changes adjacent lines. Review only the last commit here.
RNTester's iOS tabs report the insets that the content must clear through
onContentInsetsChange. They computed them only when the selected tab's safe area changed, from the tab bar's frame at that moment. The safe area can change before the tab bar controller's layout pass moves the bar, so the insets described the bar's previous position. After an unfolded iPhone Duo turned to portrait, where its side tab bar moves to the bottom, the bottom inset stayed 0 and the example list ran under the bar, where taps switch tabs.This change also computes the insets after each layout pass of the tab bar controller, which a small
UITabBarControllersubclass reports fromviewDidLayoutSubviews. The safe area is read at that time instead of being passed by the callback.Changelog:
[INTERNAL] [FIXED] - Compute RNTester's iOS tab content insets after the tab bar is laid out
Test Plan:
Ran:
RNTester builds on this base with the change (2026-11-28, Xcode 27.1):
xcodebuild -workspace packages/rn-tester/RNTesterPods.xcworkspace -scheme RNTester -configuration Debug \ -destination 'generic/platform=iOS Simulator' ARCHS=arm64 ONLY_ACTIVE_ARCH=YES CODE_SIGNING_ALLOWED=NO buildNot run: launching it. The check: on an iPhone Duo simulator, unfold RNTester in landscape and turn it to portrait, both while running and during launch. The last row of the example list ends above the tab bar; on
mainit runs under it. On an iPhone in portrait and landscape the content clears the status bar and tab bar as onmain.🤖 Generated with Claude Code