Skip to content

Commit 4454872

Browse files
committed
fix(modal): stop router from blocking when there's a backdrop breakpoint set
1 parent ef60cf1 commit 4454872

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

core/src/components/modal/modal.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -764,16 +764,18 @@ export class Modal implements ComponentInterface, OverlayInterface {
764764
this.gesture.enable(true);
765765

766766
/**
767-
* When showBackdrop or focusTrap is false, the modal's original parent may
768-
* block pointer events after the modal is moved to ion-app. This only applies
769-
* when the modal is in a child route (detected by the modal being inside
770-
* a route wrapper like ion-page). Disable pointer-events on the child
767+
* When the backdrop doesn't block pointer events (showBackdrop=false,
768+
* focusTrap=false, or backdropBreakpoint > 0), the modal's original parent
769+
* may block pointer events after the modal is moved to ion-app. This only
770+
* applies when the modal is in a child route (detected by the modal being
771+
* inside a route wrapper like ion-page). Disable pointer-events on the child
771772
* route's wrapper elements up to (and including) the first ion-router-outlet.
772773
* We stop there because parent elements may contain sibling content that
773774
* should remain interactive.
774775
* See https://github.com/ionic-team/ionic-framework/issues/30700
775776
*/
776-
if ((this.showBackdrop === false || this.focusTrap === false) && this.cachedOriginalParent) {
777+
const backdropNotBlocking = this.showBackdrop === false || this.focusTrap === false || this.backdropBreakpoint > 0;
778+
if (backdropNotBlocking && this.cachedOriginalParent) {
777779
// Find the first meaningful parent (skip template and other non-semantic wrappers).
778780
// In Ionic React, modals are wrapped in a <template> element.
779781
let semanticParent: HTMLElement | null = this.cachedOriginalParent;

0 commit comments

Comments
 (0)