Skip to content

Report font scale changes to JS while the host stays resumed (#60497) - #60497

Merged
meta-codesync[bot] merged 1 commit into
react:mainfrom
ww1321:export-D135575916
Dec 2, 2026
Merged

meta-codesync[bot] merged 1 commit into
react:mainfrom
ww1321:export-D135575916

Conversation

@ww1321

@ww1321 ww1321 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

DeviceInfoModule caches the font scale and re-reads it only in onHostResume. When the system font scale changes while the app stays resumed, ReactHostImpl.onConfigurationChanged re-lays out the native views at the new scale, but JS never receives didUpdateDimensions. Dimensions, useWindowDimensions().fontScale and PixelRatio.getFontScale() keep the old value, so a JS layout that multiplies by the font scale clips text that has already grown natively.

An app stays resumed through a font scale change when it is visible next to the system settings, for example in multi-window. ReactHostImpl.onConfigurationChanged now asks DeviceInfoModule to re-read the font scale, and the module emits didUpdateDimensions when the value changed.

Changelog:
[Android][Fixed] - Emit didUpdateDimensions when the font scale changes while the app stays resumed

Reviewed By: javache

Differential Revision: D135575916

@meta-codesync

meta-codesync Bot commented Dec 2, 2026

Copy link
Copy Markdown

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

@javache javache left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

…0497)

Summary:

`DeviceInfoModule` caches the font scale and re-reads it only in `onHostResume`. When the system font scale changes while the app stays resumed, `ReactHostImpl.onConfigurationChanged` re-lays out the native views at the new scale, but JS never receives `didUpdateDimensions`. `Dimensions`, `useWindowDimensions().fontScale` and `PixelRatio.getFontScale()` keep the old value, so a JS layout that multiplies by the font scale clips text that has already grown natively.

An app stays resumed through a font scale change when it is visible next to the system settings, for example in multi-window. `ReactHostImpl.onConfigurationChanged` now asks `DeviceInfoModule` to re-read the font scale, and the module emits `didUpdateDimensions` when the value changed.

Changelog:
[Android][Fixed] - Emit `didUpdateDimensions` when the font scale changes while the app stays resumed

Reviewed By: javache

Differential Revision: D135575916




Signed-off-by: Wei Wang <ww1@meta.com>
@meta-codesync meta-codesync Bot changed the title Report font scale changes to JS while the host stays resumed Report font scale changes to JS while the host stays resumed (#60497) Dec 2, 2026
@ww1321
ww1321 force-pushed the export-D135575916 branch from df7b9a2 to 2aa0f40 Compare December 2, 2026 21:04
@meta-codesync
meta-codesync Bot merged commit 1791386 into react:main Dec 2, 2026
7 of 8 checks passed
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @ww1321 in 1791386

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged This PR has been merged. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants