Skip to content

Fix scaled and clipped Android safe-area insets (#58997) - #58997

Closed
Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:export-D124663000
Closed

Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:export-D124663000

Conversation

@Abbondanzo

@Abbondanzo Abbondanzo commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Safe-area insets measure how far a view's rendered bounds extend into the unsafe area, in Android dp or iOS points. Views with the same rendered bounds should report the same insets, regardless of scale or content padding. Fix Android's calculation to use the full transformed bounds instead of mixing a clipped origin with untransformed dimensions, and preserve fractional values through the single density conversion. The example compares a 1× root and a 2× observer without applying padding. iOS native behavior is unchanged.

Changelog:
[Android][Fixed] - Correct safe-area inset measurements for scaled views and views clipped by ancestors.

Reviewed By: fkgozali

Differential Revision: D124663000

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 12, 2026
@meta-codesync

meta-codesync Bot commented Oct 12, 2026

Copy link
Copy Markdown

@Abbondanzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D124663000.

@meta-codesync meta-codesync Bot changed the title Fix scaled and clipped Android safe-area insets Fix scaled and clipped Android safe-area insets (#58997) Oct 12, 2026
Abbondanzo added a commit to Abbondanzo/react-native that referenced this pull request Oct 12, 2026
Summary:

Safe-area insets measure how far a view's rendered bounds extend into the unsafe area, in Android dp or iOS points. Views with the same rendered bounds should report the same insets, regardless of scale or content padding. Fix Android's calculation to use the full transformed bounds instead of mixing a clipped origin with untransformed dimensions, and preserve fractional values through the single density conversion. The example compares a 1× root and a 2× observer without applying padding. iOS native behavior is unchanged.

Changelog:
[Android][Fixed] - Correct safe-area inset measurements for scaled views and views clipped by ancestors.

Differential Revision: D124663000
Summary:

Safe-area insets measure how far a view's rendered bounds extend into the unsafe area, in Android dp or iOS points. Views with the same rendered bounds should report the same insets, regardless of scale or content padding. Fix Android's calculation to use the full transformed bounds instead of mixing a clipped origin with untransformed dimensions, and preserve fractional values through the single density conversion. The example compares a 1× root and a 2× observer without applying padding. iOS native behavior is unchanged.

Changelog:
[Android][Fixed] - Correct safe-area inset measurements for scaled views and views clipped by ancestors.

Reviewed By: fkgozali

Differential Revision: D124663000
@meta-codesync meta-codesync Bot closed this in 9641acd Oct 12, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Oct 12, 2026
@meta-codesync

meta-codesync Bot commented Oct 12, 2026

Copy link
Copy Markdown

This pull request has been merged in 9641acd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant