File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
core/src/components/modal Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export class Modal implements ComponentInterface, OverlayInterface {
7171 private gesture ?: Gesture ;
7272 private coreDelegate : FrameworkDelegate = CoreDelegate ( ) ;
7373 private sheetTransition ?: Promise < any > ;
74- private isSheetModal = false ;
74+ @ State ( ) private isSheetModal = false ;
7575 private currentBreakpoint ?: number ;
7676 private wrapperEl ?: HTMLElement ;
7777 private backdropEl ?: HTMLIonBackdropElement ;
@@ -644,7 +644,14 @@ export class Modal implements ComponentInterface, OverlayInterface {
644644 window . addEventListener ( KEYBOARD_DID_OPEN , this . keyboardOpenCallback ) ;
645645 }
646646
647- if ( this . isSheetModal ) {
647+ /**
648+ * Recalculate isSheetModal because framework bindings (e.g., Angular)
649+ * may not have been applied when componentWillLoad ran.
650+ */
651+ const isSheetModal = this . breakpoints !== undefined && this . initialBreakpoint !== undefined ;
652+ this . isSheetModal = isSheetModal ;
653+
654+ if ( isSheetModal ) {
648655 this . initSheetGesture ( ) ;
649656 } else if ( hasCardModal ) {
650657 this . initSwipeToClose ( ) ;
You can’t perform that action at this time.
0 commit comments