Skip to content

Correctly create the first modal state - #52835

Closed
cortinico wants to merge 1 commit into
mainfrom
nc/modal-fix
Closed

Correctly create the first modal state#52835
cortinico wants to merge 1 commit into
mainfrom
nc/modal-fix

Conversation

@cortinico

Copy link
Copy Markdown
Contributor

Summary:

There is currently a bug with Modals with New Architecture where the first frame is rendered incorrectly, specifically not accounting for all the vertical insets (only the status bar). This fixes it.

Changelog:

[ANDROID] [FIXED] - Correctly account for insets on first render of Modals on New Arch

Test Plan:

See internal CI

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Jul 25, 2025
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this in D78975126.

@github-actions

Copy link
Copy Markdown

Job Summary for Gradle

Test All :: build_android
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
react-native-github publishAllToMavenTempLocal build 8.14.3 Build Scan not published

facebook-github-bot pushed a commit that referenced this pull request Jul 28, 2025
Summary:
There is currently a bug with Modals with New Architecture where the first frame is rendered incorrectly, specifically not accounting for all the vertical insets (only the status bar). This fixes it.

## Changelog:

[ANDROID] [FIXED] - Correctly account for insets on first render of Modals on New Arch


Test Plan: See internal CI

Differential Revision: D78975126

Pulled By: cortinico
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D78975126

@github-actions

Copy link
Copy Markdown

Job Summary for Gradle

Test All :: run_fantom_tests
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
react-native-github :private:react-native-fantom:buildFantomTester 8.14.3 Build Scan not published

facebook-github-bot pushed a commit that referenced this pull request Jul 30, 2025
Summary:
There is currently a bug with Modals with New Architecture where the first frame is rendered incorrectly, specifically not accounting for all the vertical insets (only the status bar). This fixes it.

Specifically:
1. I've removed the caching of the statusbar height from `ReactModalHostView` as that was not working correctly. Sometimes the value returned `0` meaning that it was not yet computed when Fabric was asking for it. In the updated implementation we now query `FabricUIManager` given the `surfaceId` of the modal.
2. I've modified the logic to account for all the vertical insets, not just the status bar.

## Changelog:

[ANDROID] [FIXED] - Correctly account for insets on first render of Modals on New Arch


Test Plan:
Tested on Marketplace Location Picker and the picker is still working correctly:

 https://pxl.cl/7NjtJ

Differential Revision: D78975126

Pulled By: cortinico
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D78975126

@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D78975126

cortinico added a commit that referenced this pull request Aug 1, 2025
Summary:
There is currently a bug with Modals with New Architecture where the first frame is rendered incorrectly, specifically not accounting for all the vertical insets (only the status bar). This fixes it.

Specifically:
1. I've removed the caching of the statusbar height from `ReactModalHostView` as that was not working correctly. Sometimes the value returned `0` meaning that it was not yet computed when Fabric was asking for it. In the updated implementation we now query `FabricUIManager` given the `surfaceId` of the modal.
2. I've modified the logic to account for all the vertical insets, not just the status bar.

## Changelog:

[ANDROID] [FIXED] - Correctly account for insets on first render of Modals on New Arch

Pull Request resolved: #52835

Test Plan:
Tested on Marketplace Location Picker and the picker is still working correctly:

 https://pxl.cl/7NjtJ

Reviewed By: mdvacca

Differential Revision: D78975126

Pulled By: cortinico
@react-native-bot react-native-bot added the Merged This PR has been merged. label Aug 1, 2025
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @cortinico in 3799da0

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

@github-actions

github-actions Bot commented Aug 1, 2025

Copy link
Copy Markdown

Job Summary for Gradle

Test All :: run_fantom_tests
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
react-native-github :private:react-native-fantom:buildFantomTester 8.14.3 Build Scan not published

@github-actions

github-actions Bot commented Aug 1, 2025

Copy link
Copy Markdown

Job Summary for Gradle

Test All :: build_android
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
react-native-github publishAllToMavenTempLocal build 8.14.3 Build Scan not published

Summary:
There is currently a bug with Modals with New Architecture where the first frame is rendered incorrectly, specifically not accounting for all the vertical insets (only the status bar). This fixes it.

Specifically:
1. I've removed the caching of the statusbar height from `ReactModalHostView` as that was not working correctly. Sometimes the value returned `0` meaning that it was not yet computed when Fabric was asking for it. In the updated implementation we now query `FabricUIManager` given the `surfaceId` of the modal.
2. I've modified the logic to account for all the vertical insets, not just the status bar.

## Changelog:

[ANDROID] [FIXED] - Correctly account for insets on first render of Modals on New Arch


Test Plan:
Tested on Marketplace Location Picker and the picker is still working correctly:

 https://pxl.cl/7NjtJ

Reviewed By: mdvacca

Differential Revision: D78975126

Pulled By: cortinico
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D78975126

cortinico added a commit to cortinico/react-native that referenced this pull request Aug 7, 2025
Summary:
There is currently a bug with Modals with New Architecture where the first frame is rendered incorrectly, specifically not accounting for all the vertical insets (only the status bar). This fixes it.

## Changelog:

[ANDROID] [FIXED] - Correctly account for insets on first render of Modals on New Arch

Pull Request resolved: react#52835

Test Plan: See internal CI

Differential Revision: D78975126

Pulled By: cortinico
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @cortinico in 2e76fc8

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

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. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants