Repository navigation
Remove RNTester's bottom padding under the iPad's floating tab bar - #60370
Conversation
dd903e4 to
419f93b
Compare
On iPad a floating tab bar along the top replaces the bottom tab bar. RNTester's tabs still counted the replaced bar as a bottom bar, because it is not hidden and keeps a full-width frame at the bottom edge, so the content got the 65-point bottom inset, and each example page ended with 65 points of empty space. The replaced bar is not in a window, so only count a tab bar that is. The top inset no longer gets the bottom-bar minimum there either. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
419f93b to
501f9be
Compare
chrfalch
left a comment
There was a problem hiding this comment.
The tabBar.window != nil check looks like the right signal for the replaced bar. Two requests:
1. Split view, Slide Over and rotation. In a compact-width window (for example half the screen in split view, or Slide Over), iPadOS brings the bottom tab bar back, so the 65-point inset has to come back with it. That depends on tabSafeAreaInsetsDidChange running at that moment and seeing the bar in a window. Could you check by hand: resize into split view and back, open in Slide Over, and rotate. The bottom inset should follow the bar each time.
2. Screenshots. The iPad case reproduces on every launch on the iPad Pro 13-inch simulator. Before/after screenshots of the end of an example page such as Button (158 vs 93 points above the bottom) would make the fix easy to see.
With those covered, this looks good and can be approved.
|
@javache has imported this pull request. If you are a Meta employee, you can view this in D135070384. |
christophpurrer
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
This pull request was successfully merged by @ide in 3c04ce7 When will my fix make it into a release? | How to file a pick request? |
Summary:
On iPad a floating tab bar along the top replaces the bottom tab bar. RNTester's tabs still counted the replaced bar as a bottom bar, because it is not hidden and keeps a full-width frame at the bottom edge (
{{0, 1312}, {1032, 64}}on an iPad Pro 13-inch). The content got the 65-point bottom inset meant to clear a bottom bar, which example pages use as bottom padding, so each ended with 65 points of empty space. The home list is unaffected either way: its footer is at least 80 points tall.The replaced bar is not in a window, so this change counts a tab bar as a bottom bar only when it is in one. With no bottom bar the bottom inset is 0, not the iPad's 20-point bottom safe area, as it already is for the iPhone Duo's side tab bar. The top inset also leaves the bottom-bar branch, so it loses that branch's 50-point minimum.
Changelog:
[INTERNAL] [FIXED] - Remove the bottom padding from RNTester's content on iPad
Test Plan:
RNTester builds (Xcode 27.1). Run in Debug on an iPad Pro 13-inch (M5) and an iPhone 18 Pro simulator (iOS 27.0). A local UI test measures how far the Button example page's lowest text, scrolled to the end, sits above the bottom of the window:
main, 93 on this branch.The home list's last row is at y = 1291 in a 1376-point window on both builds, so the change of top inset does not move the layout. A local log in
tabSafeAreaInsetsDidChangeshows the iPad'stabBar.windowis nil in every call.