Skip to content

Commit 43d0090

Browse files
WoLewickija1ns
authored andcommitted
feat: proper snapshot when having multiple modals (software-mansion#2121)
PR handling setting a proper snapshot of a modal when it is dismissed from JS on new arch. Still does not work with Test1829
1 parent 789c27e commit 43d0090

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ios/RNSScreenStack.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,11 @@ - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childCompo
11751175

11761176
- (void)takeSnapshot
11771177
{
1178-
_snapshot = [_controller.visibleViewController.view snapshotViewAfterScreenUpdates:NO];
1178+
if (_presentedModals.count < 2) {
1179+
_snapshot = [_controller.visibleViewController.view snapshotViewAfterScreenUpdates:NO];
1180+
} else {
1181+
_snapshot = [[_presentedModals.lastObject view] snapshotViewAfterScreenUpdates:NO];
1182+
}
11791183
}
11801184

11811185
- (void)mountingTransactionWillMount:(react::MountingTransaction const &)transaction

0 commit comments

Comments
 (0)