Skip to content

Commit

Permalink
feat: proper snapshot when having multiple modals (#2121)
Browse files Browse the repository at this point in the history
PR handling setting a proper snapshot of a modal when it is dismissed from JS on new arch. Still does not work with Test1829
  • Loading branch information
WoLewicki committed May 14, 2024
1 parent 56f7bb5 commit cfcd5c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ios/RNSScreenStack.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,11 @@ - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childCompo

- (void)takeSnapshot
{
_snapshot = [_controller.visibleViewController.view snapshotViewAfterScreenUpdates:NO];
if (_presentedModals.count < 2) {
_snapshot = [_controller.visibleViewController.view snapshotViewAfterScreenUpdates:NO];
} else {
_snapshot = [[_presentedModals.lastObject view] snapshotViewAfterScreenUpdates:NO];
}
}

- (void)mountingTransactionWillMount:(react::MountingTransaction const &)transaction
Expand Down

0 comments on commit cfcd5c3

Please sign in to comment.