Skip to content

[iOS] Fabric: Fixes Modal present splash when animation type is none#41853

Closed
zhongwuzw wants to merge 4 commits into
facebook:mainfrom
zhongwuzw:features/fix_modal_splash
Closed

[iOS] Fabric: Fixes Modal present splash when animation type is none#41853
zhongwuzw wants to merge 4 commits into
facebook:mainfrom
zhongwuzw:features/fix_modal_splash

Conversation

@zhongwuzw
Copy link
Copy Markdown
Contributor

Summary:

Because the modal layout is triggered by state, it's an async operation after the first mount, so we can see the splash when present modal. now we can pass the screen size to the initial state which can layout in the first mount operation.

before:
https://github.com/facebook/react-native/assets/5061845/a39d519e-e2f6-42f1-8319-6216c88e9cf3

After:
https://github.com/facebook/react-native/assets/5061845/c7d59820-399b-4ea2-943d-d889971ea7ee

Changelog:

[IOS] [FIXED] - Fabric: Fixes Modal present splash when animation type is none

Test Plan:

RNTester Modal example, present modal in none animation mode.

@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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Dec 8, 2023
@analysis-bot
Copy link
Copy Markdown

analysis-bot commented Dec 8, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 21,284,141 +2
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 24,481,165 +0
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 12b64b7
Branch: main

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@dmytrorykun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@zhongwuzw
Copy link
Copy Markdown
Contributor Author

@dmytrorykun Hi, friendly ping, any progress on reviewing this PR?

Copy link
Copy Markdown
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

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

Hi @zhongwuzw, sorry for the very late reply. I left a review internally back in december but haven't realized that this was a PR from OSS. 🤦

Unfortunately, I don't think that the PR is good as it is. I left some suggestions to start with, but I want to explore the problem a little more to find a better solution that won't require weird path and dependencies.

Comment on lines 19 to 21
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.

I wonder if we can find a way to avoid this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@cipolleschi Emm, perhaps we should not share a common ModalHostViewState and instead have separate ModalHostViewStates for different platforms?

Comment on lines 32 to 41
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.

what if we pass a Size parameter which is {0,0} by default and then we look if there is a way to inject the size from the iOS mounting layer? 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@cipolleschi I tried to change the size before the mount view, but it's too late because we need to get the correct layout info in the layout phase

@zhongwuzw zhongwuzw force-pushed the features/fix_modal_splash branch from 201d0a4 to 5a739c5 Compare March 4, 2024 07:11
@zhongwuzw zhongwuzw force-pushed the features/fix_modal_splash branch from 5a739c5 to a6e5702 Compare April 9, 2024 02:15
@cipolleschi
Copy link
Copy Markdown
Contributor

Sorry if this is taking too long. It is in my queue and I'll get to it at some point, hopefully soon!

@zhongwuzw
Copy link
Copy Markdown
Contributor Author

Merge main branch to fix the conflict.

@zhongwuzw
Copy link
Copy Markdown
Contributor Author

@cipolleschi Hi, any chance to keep forward this PR? :)

@cipolleschi
Copy link
Copy Markdown
Contributor

Let me import this and let's see if some colleague has some ideas on how to approach this better or if they are happy with this! :D

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jul 18, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@cipolleschi merged this pull request in 14de1b7.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @zhongwuzw in 14de1b7

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. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants