Skip to content
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

[iOS] Fabric: Fixes Modal snapshot when closing it #48252

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ @implementation RCTModalHostViewComponentView {
BOOL _shouldAnimatePresentation;
BOOL _shouldPresent;
BOOL _isPresented;
UIView *_modalContentsSnapshot;
}

- (instancetype)initWithFrame:(CGRect)frame
Expand Down Expand Up @@ -141,7 +140,6 @@ - (void)dismissViewController:(UIViewController *)modalViewController
animated:(BOOL)animated
completion:(void (^)(void))completion
{
_modalContentsSnapshot = [self.viewController.view snapshotViewAfterScreenUpdates:NO];
[modalViewController dismissViewControllerAnimated:animated completion:completion];
}

Expand All @@ -167,8 +165,7 @@ - (void)ensurePresentedOnlyIfNeeded
_isPresented = NO;
// To animate dismissal of view controller, snapshot of
// view hierarchy needs to be added to the UIViewController.
UIView *snapshot = _modalContentsSnapshot;

UIView *snapshot = [self.viewController.view snapshotViewAfterScreenUpdates:NO];
if (_shouldPresent) {
[self.viewController.view addSubview:snapshot];
}
Expand Down
Loading