question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Modal backdrop click prevented by .modal-shadow element (mode: 'ios')

See original GitHub issue

Bug Report

Ionic version: [x] 5.x

Current behavior: When using a modal with mode: 'ios', the .modal-shadow element prevents clicking the backdrop to dismiss the modal

Expected behavior: The backdrop should be clickable to dismiss the modal.

Demo code: https://stackblitz.com/edit/ionic-4-angular-8-start-template-ejcn8f

Ionic info:

Ionic:

   Ionic CLI                     : 6.9.3 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.1.1
   @angular-devkit/build-angular : 0.803.26
   @angular-devkit/schematics    : 9.0.7
   @angular/cli                  : 8.3.25
   @ionic/angular-toolkit        : 2.2.0

Cordova:

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

Utility:

   cordova-res                          : not installed
   native-run (update available: 1.0.0) : 0.2.3

System:

   ios-sim : 8.0.2
   NodeJS  : v12.16.0 (/usr/local/Cellar/node@12/12.16.0/bin/node)
   npm     : 6.14.5
   OS      : macOS Catalina
   Xcode   : Xcode 11.5 Build version 11E608c

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
liamdebeasicommented, Jun 3, 2020

Thanks for the issue. I am going to close this as this is not a bug in Ionic Framework.

To get this to work, you can add the following to your global CSS:

ion-modal .modal-shadow {
  pointer-events: none;
}
0reactions
ionitron-bot[bot]commented, Jul 3, 2020

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: Modal backdrop click prevented by .modal-shadow ...
Expected behavior: The backdrop should be clickable to dismiss the modal. Demo code: https://stackblitz.com/edit/ionic-4-angular- ...
Read more >
Bootstrap Modal Backdrop Remaining - Stack Overflow
If after modal hide, faded background is remained and does not let you click any where you can forcefully remove those by using...
Read more >
ion-modal: Ionic Mobile App Custom Modal API Component
Developers should listen for the ionModalDidDismiss or didDismiss event and set isOpen to false . The reason for this is it prevents the...
Read more >
Modal · Bootstrap v5.2
When backdrop is set to static, the modal will not close when clicking outside of it. Click the button below to try it....
Read more >
Modal - UIkit
The Modal component consists of an overlay, a dialog and an optional close button. You can use any element to toggle a modal...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found