ionic-framework: bug: ion-modal `swipeToClose` no longer has any effect when `mode=ios` without `presentingElement`

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

Using swipeToClose on modals no longer works unless using the new card style modal. We had previously used this function even on normal modals to allow users to swipe and dismiss.

Expected Behavior

swipeToClose should stay available without presentingElement. (Note, I see this is deprecated, but the functionality has been removed in a breaking way and it would be nice if this could stay available (not just for the new card-style modals.)

Steps to Reproduce

Create a modal that does not have a presentingElement (e.g. just a plain modal, not a card, not a bottom-sheet).

        this.modal = await this.modalCtrl.create({
          component: MyModalComponent,
          swipeToClose: true,
          showBackdrop: true,
          animated: true,
          mode: 'ios',
        });

The modal will display but not be swipable. This previously worked in Ionic 6.1.1 but is now broken in 6.1.7.

Working 6.1.1: https://user-images.githubusercontent.com/362329/170589579-22176427-8a7c-4a2a-abb6-675f3f7765c8.mov

Broken 6.1.7: https://user-images.githubusercontent.com/362329/170589426-a23668cc-6a28-4361-b23e-da29bb0dfcfd.mov

Code Reproduction URL

No response

Ionic Info

mshark:topdecked-unified lincoln$ ionic info [WARN] Error loading @ionic/angular package.json: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath ‘./package’ is not defined by “exports” in /Users/lincoln/projects/maritlabs/topdecked-unified/node_modules/@ionic/angular/package.json

Ionic:

Ionic CLI : 6.19.0 (/Users/lincoln/.nvm/versions/node/v14.19.0/lib/node_modules/@ionic/cli) Ionic Framework : not installed @angular-devkit/build-angular : 14.0.0-rc.2 @angular-devkit/schematics : 14.0.0-rc.2 @angular/cli : 14.0.0-rc.2 @ionic/angular-toolkit : 6.1.0

Capacitor:

Capacitor CLI : 3.4.3 @capacitor/android : 3.4.3 @capacitor/core : 3.4.3 @capacitor/ios : 3.4.3

Utility:

cordova-res : not installed globally native-run (update available: 1.6.0) : 1.5.0

System:

NodeJS : v14.19.0 (/Users/lincoln/.nvm/versions/node/v14.19.0/bin/node) npm : 6.14.16 OS : macOS Monterey

─────────────────────────────────────────────────

 Ionic CLI update available: 6.19.0 → 6.19.1
      Run npm i -g @ionic/cli to update

─────────────────────────────────────────────────

mshark:topdecked-unified lincoln$

Additional Information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 31 (11 by maintainers)

Most upvoted comments

Sounds good to me 😃 Closing this. Much appreciated for everything as always, Liam.

backdropBreakpoint is a feature exclusive to the sheet modal, so I would not expect it to work with the card modal.

Right, just had to say it out loud 😃