chore(android-new-arch): reproduce modal layout issues #50704
+132
−9
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:
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:
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: