Skip to content

Commit c65fc63

Browse files
cipolleschimeta-codesync[bot]
authored andcommitted
Keep RNTester content clear of the iOS tab bar (#58933)
Summary: The iOS RNTester E2E job fails on every PR. `flatlist-append-maintainvisible.yml` fails with `Element not found: Id matching regex: scroll-offset-display`. It started with #58900 (8d8b8f3). #58900 caps the bottom content inset at 65pt when the tab bar is along the bottom (`insets.bottom = MIN(insets.bottom, LegacyBottomInset)`), but the tab bar is 83pt tall on current iPhones. The bottom 18pt of every RNTester screen sits under the tab bar. A tap there switches tabs instead of reaching the content. That's what breaks the flow. The maintainVisibleContentPosition example pins its controls to the bottom of the screen. Its last row ("Clear (empty list)" / "Reset", y=866–882 on an iPhone 17 Pro Max) straddles the tab bar's top edge (y=873). Maestro taps "Reset" at its center, (326, 874), and that lands on the **Playground** tab. The next lookup of `scroll-offset-display` then fails because RNTester is on a different screen. This PR changes the `MIN` to `MAX`, matching the top inset's `MAX(insets.top, LegacyTopInset)`. The bottom inset is now never smaller than the system inset, so content stays clear of the tab bar. On devices whose inset is under 65pt, it still keeps the legacy 65pt bounds that #58900 wanted. Trade-off: on devices where the tab bar is taller than 65pt (83pt on current iPhones), examples are now 18pt shorter than #58900 intended. That's the space the tab bar covers. ## Changelog: [INTERNAL] - Keep RNTester content clear of the iOS tab bar Pull Request resolved: #58933 Test Plan: On an iPhone 17 Pro Max simulator (iOS 26.5): - With the build from `main`, ran `maestro test packages/rn-tester/.maestro/flatlist-append-maintainvisible.yml --debug-output <dir>` (Maestro 2.6.1, same as CI). It failed after `Tap on "Reset"`. The debug output shows the tap on `Reset` (bounds `[222,866][430,882]`) and the failure screenshot shows the Playground tab. - Built RNTester Debug using the full system bottom inset and read the layout with `idb ui describe-all`. The Clear/Reset row moved from y=--sanitized-- Reviewed By: cortinico Differential Revision: D123941583 Pulled By: cipolleschi fbshipit-source-id: b4cbfbb763edad19fe167f0295a55064b7c6786c
1 parent 2bd0106 commit c65fc63

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎packages/rn-tester/RNTesterTabsIOS/ios/RNTesterTabsIOSComponentView.mm‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ - (void)tabSafeAreaInsetsDidChange:(UIEdgeInsets)insets
221221
CGRectGetMaxY(tabBarFrame) >= CGRectGetMaxY(bounds);
222222
if (hasBottomTabBar) {
223223
insets.top = MAX(insets.top, LegacyTopInset);
224-
insets.bottom = MIN(insets.bottom, LegacyBottomInset);
224+
// Never go below the system inset: anything less leaves content under the tab bar, where taps switch tabs.
225+
insets.bottom = MAX(insets.bottom, LegacyBottomInset);
225226
} else {
226227
insets.bottom = 0;
227228
// A window with no status bar along the top, such as the iPhone Duo's, reports no top inset. Keep

0 commit comments

Comments
 (0)