Skip to content

Commit

Permalink
feat: proper snapshot when having multiple modals (software-mansion#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 authored and ja1ns committed Oct 9, 2024
1 parent 789c27e commit 43d0090
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 43d0090

Please sign in to comment.