Skip to content

chore(android-new-arch): reproduce modal layout issues #50704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AndreiCalazans
Copy link
Contributor

@AndreiCalazans AndreiCalazans commented Apr 14, 2025

Summary:

Note: this reproducible patch was made on top of 0.76 stable branch however this is reproducible on latest main.

We are experiencing an issue with Modals on Android when the new architecture is enabled.

When trying to render a modal, especially in a busy JS thread on Android, the rendered UI does not match expected layout. This either causes a layout glitch, where the Modal content flashes an incorrect layout, or a Modal's inner content layout fully broken (see image below).

In this example below, we were mounting then unmounting a few Modals in sequence and eventually (inconsistently happening) the app gets into a frozen state where no user input gets through the app anymore. When inspecting the UI layout on Android Studio it shows that Android's Dialog is rendered as expected fully covering the UI however its children content has incorrect width values:

image

When we attempt to reproduce this issue in rn-tester we couldn't exactly replicate the frozen UI state however we can see replicate the incorect layout issues occuring when in a busy thread:

Video of the incorrect layout rendered on Android with new architecture enabled.

Same experience without new arch enabled on Android - has o glitch despite very busy JS thread.

There seems to be a shared theme here with onLayout returning empty layout dimensions during first mount which others have observed that this also breaks layout animations from Reanimated.

Other observations. If we wrap the Modal's children with a View that has fixed width and height we do see the entire content properly rendered however the touch system is broken and the children is unable to receive presses.

Changelog:

Test Plan:

@facebook-github-bot facebook-github-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 Apr 14, 2025
@react-native-bot
Copy link
Collaborator

react-native-bot commented Apr 14, 2025

Fails
🚫

📋 Verify Changelog Format - See Changelog format

Generated by 🚫 dangerJS against de31b10

@AndreiCalazans AndreiCalazans changed the title chore: attempt reproducing modal layout issues on new arch chore(android new arch): attempt reproducing modal layout issues Apr 14, 2025
@AndreiCalazans AndreiCalazans changed the title chore(android new arch): attempt reproducing modal layout issues chore(android new arch): reproduce modal layout issues Apr 14, 2025
@AndreiCalazans AndreiCalazans changed the title chore(android new arch): reproduce modal layout issues chore(android-new-arch): reproduce modal layout issues Apr 14, 2025
@cortinico
Copy link
Contributor

@AndreiCalazans can you send this against main?

Also could you edit the RNTesterPlayground.js file to reproduce this issue?

@AndreiCalazans AndreiCalazans changed the base branch from 0.76-stable to main April 15, 2025 12:12
@AndreiCalazans AndreiCalazans changed the base branch from main to 0.76-stable April 15, 2025 12:16
@AndreiCalazans AndreiCalazans force-pushed the andrei/reproduce-modal-issue-new-arch branch from e5f8f7c to de31b10 Compare April 15, 2025 12:50
@AndreiCalazans AndreiCalazans changed the base branch from 0.76-stable to main April 15, 2025 12:50
@AndreiCalazans
Copy link
Contributor Author

@cortinico sure. updated base to main and moved code to playground instead.

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. Pick Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants