Skip to content

bug: modal doesn't dismiss when backdrop is clicked on IOS #21272

@chris-cornwall

Description

@chris-cornwall

Bug Report

Ionic version:

[x] 5.x

Current behavior:

On IOS, ion-modal does not dismiss when backdrop is clicked even though backdropDismiss is set to true.

Expected behavior:

ion-modal should dismiss when backdropDismiss is set to true.

Steps to reproduce:

Open a modal which has backdropDismiss set to true and click the backdrop.

Related code:

Template

    const modal = await this.modalController.create({
      component: ItemModalPage,
      cssClass: 'item-modal',
      backdropDismiss: true,
      showBackdrop: true,
      animated: true,
      componentProps: {
        item: item,
      },
    });

CSS

.item-modal .modal-wrapper {
  top: 40%;
  bottom: 0;
  left: 0;
  right: 0;
  position: fixed;
  display: block;
  border-radius: 2px;
  min-width: 100%;

}

Other information:

As mentioned above, this only seems to happen on IOS

Ionic info:

Ionic:

   Ionic CLI                     : 5.4.13 (/Users/chris/.nvm/versions/node/v12.9.0/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 5.1.0
   @angular-devkit/build-angular : 0.1000.0-next.3
   @angular-devkit/schematics    : 10.0.0-next.3
   @angular/cli                  : 9.1.4
   @ionic/angular-toolkit        : 2.0.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 7 other plugins)

Utility:

   cordova-res : not installed
   native-run  : 1.0.0

System:

   Android SDK Tools : 26.1.1 (/Users/chris/Library/Android/sdk/)
   NodeJS            : v12.9.0 (/Users/chris/.nvm/versions/node/v12.9.0/bin/node)
   npm               : 6.14.4
   OS                : macOS Catalina

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions