Repository navigation
Apply safe area insets RTL-aware in RNTester and helloworld (#59645) - #59645
Open
Abbondanzo wants to merge 2 commits into
Open
Abbondanzo wants to merge 2 commits into
Abbondanzo wants to merge 2 commits into
Conversation
…t#58112) Summary: The private `SafeAreaView` used by LogBox, the element inspector and `InputAccessoryView` now pads its children from the `experimental_onSafeAreaInsetsChange` prop instead of wrapping the native `RCTSafeAreaView`. It also works on Android, where it was a plain `View` before. The callers that still used the deprecated public `SafeAreaView` move off it: RNTester's platform test results view and the helloworld app use the insets prop, typed with `SafeAreaInsets`, which is now exported alongside `SafeAreaInsetsChangeEvent`. LogBox's inspector header drops its Android-only `View` fallback. The native view is left in place for the deprecated public `SafeAreaView`; react#58113 removes it. ## Changelog: [ANDROID] [FIXED] - LogBox, the element inspector and `InputAccessoryView` now apply safe area padding on Android [GENERAL] [ADDED] - Export the `SafeAreaInsets` type Pull Request resolved: react#58112 Test Plan: ``` yarn test packages/react-native/Libraries/LogBox # 101 passed, 3 snapshots updated yarn flow-check # 0 errors ``` LogBox notification, LogBox inspector and element inspector on iOS and Android, plus `InputAccessoryView` on iOS: | | LogBox notification | LogBox inspector | Element inspector | | |---|---|---|---|---| | iOS | <img src="https://raw.githubusercontent.com/janicduplessis/react-native/cf6fa5bb55818587767eb6b47a10b8970864f932/ios-logbox-notification.png" width="200"> | <img src="https://raw.githubusercontent.com/janicduplessis/react-native/cf6fa5bb55818587767eb6b47a10b8970864f932/ios-logbox-inspector.png" width="200"> | <img src="https://raw.githubusercontent.com/janicduplessis/react-native/cf6fa5bb55818587767eb6b47a10b8970864f932/ios-inspector.png" width="200"> | <img src="https://raw.githubusercontent.com/janicduplessis/react-native/cf6fa5bb55818587767eb6b47a10b8970864f932/ios-iav-keyboard.png" width="200"><br>`InputAccessoryView` | | Android | <img src="https://raw.githubusercontent.com/janicduplessis/react-native/cf6fa5bb55818587767eb6b47a10b8970864f932/android-logbox-notification.png" width="200"> | <img src="https://raw.githubusercontent.com/janicduplessis/react-native/cf6fa5bb55818587767eb6b47a10b8970864f932/android-logbox-inspector.png" width="200"> | <img src="https://raw.githubusercontent.com/janicduplessis/react-native/cf6fa5bb55818587767eb6b47a10b8970864f932/android-inspector.png" width="200"> | <img src="https://raw.githubusercontent.com/janicduplessis/react-native/cf6fa5bb55818587767eb6b47a10b8970864f932/android-inspector-top.png" width="200"><br>Element inspector, panel at the top | --- 👉 1. react#58112 — Render the internal SafeAreaView from the safe area insets prop 2. react#58113 — Remove the native SafeAreaView and the deprecated public export Differential Revision: D126071736 Pulled By: Abbondanzo
|
@Abbondanzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D128337176. |
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
) Summary: Pull Request resolved: react#59645 RNTester's platform test results view and the helloworld app pad themselves from `experimental_onSafeAreaInsetsChange`, mapping `insets.left`/`insets.right` straight to `paddingLeft`/`paddingRight`. Insets are physical edges, but Yoga treats `paddingLeft`/`paddingRight` as start/end when `swapLeftAndRightInRTL` is on, so in RTL a right-edge cutout was left unpadded while the left edge got its padding. Both callers now swap the left and right insets in that case, as the internal `SafeAreaView` already does. Also updates the LogBox inspector, inspector footer and inspector header Fantom snapshots for the internal `SafeAreaView`'s wrapper view. Changelog: [Internal] Reviewed By: andrewdacenko Differential Revision: D128337176
Abbondanzo
force-pushed
the
export-D128337176
branch
from
October 29, 2026 21:32
ef6e883 to
4db69fd
Compare
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:
RNTester's platform test results view and the helloworld app pad themselves from
experimental_onSafeAreaInsetsChange, mappinginsets.left/insets.rightstraight topaddingLeft/paddingRight. Insets are physical edges, but Yoga treatspaddingLeft/paddingRightas start/end whenswapLeftAndRightInRTLis on, so in RTL a right-edge cutout was left unpadded while the left edge got its padding. Both callers now swap the left and right insets in that case, as the internalSafeAreaViewalready does.Also updates the LogBox inspector, inspector footer and inspector header Fantom snapshots for the internal
SafeAreaView's wrapper view.Changelog:
[Internal]
Reviewed By: andrewdacenko
Differential Revision: D128337176