Skip to content

Commit d138ac0

Browse files
authored
fix(ios): prevent transitionCoordinator usage during modal presentation (#10153)
closes #10115
1 parent 760bbd0 commit d138ac0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/core/ui/frame/index.ios.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ export class Frame extends FrameBase {
118118
if (!this._currentEntry) {
119119
// Update action-bar with disabled animations before the initial navigation.
120120
this._updateActionBar(backstackEntry.resolvedPage, true);
121-
this.pushViewControllerAnimated(viewController, animated);
121+
// Core defaults modalPresentationStyle to 1 for standard frame navigation
122+
// for all others, it's modal presentation
123+
this.pushViewControllerAnimated(viewController, animated, this._ios?.controller?.modalPresentationStyle !== 1);
122124
if (Trace.isEnabled()) {
123125
Trace.write(`${this}.pushViewControllerAnimated(${viewController}, ${animated}); depth = ${navDepth}`, Trace.categories.Navigation);
124126
}
@@ -180,13 +182,14 @@ export class Frame extends FrameBase {
180182
}
181183
}
182184

183-
private pushViewControllerAnimated(viewController: UIViewController, animated: boolean) {
185+
private pushViewControllerAnimated(viewController: UIViewController, animated: boolean, isModal: boolean) {
184186
let transitionCoordinator = this._ios.controller.transitionCoordinator;
185-
if (transitionCoordinator) {
187+
if (!isModal && transitionCoordinator) {
186188
transitionCoordinator.animateAlongsideTransitionCompletion(null, () => {
187189
this._ios.controller.pushViewControllerAnimated(viewController, animated);
188190
});
189191
} else {
192+
// modal should always push immediately without transition coordinator
190193
this._ios.controller.pushViewControllerAnimated(viewController, animated);
191194
}
192195
}

0 commit comments

Comments
 (0)