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: iOS card modal over card modal backdrop issue

See original GitHub issue

Prerequisites

Ionic Framework Version

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

Current Behavior

The sheet modal on iOS has a backdrop natively, but when you add this and show 2 or more modals over each other (modal over modal) the backdrop gets a bit of the glitch.

Screenshot 2022-05-04 at 15 44 09

I know that by default the backdrop is removed in Ionic. But since we have a light background, this just isn’t an option for us, it just seems to connect too much with the background). So I’m looking for a solution or a workaround.

Expected Behavior

Only show backdrop of top layer modal

Steps to Reproduce

  1. Create a card modal and then another one with that previous modal as presentingElement
  2. Add backdrop opacity to modal
ion-modal::part(backdrop) {
    opacity: 0.3;
}

Code Reproduction URL

https://github.com/SaroGFX/modal-over-modal.git

Ionic Info

Ionic:

Ionic CLI : 6.19.0 (/usr/local/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/react 6.0.13

Capacitor:

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

Utility:

cordova-res : 0.15.4 native-run : 1.5.0

System:

NodeJS : v16.14.0 (/usr/local/bin/node) npm : 8.3.1 OS : macOS Monterey

Additional Information

Created demo - see repo

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
SaroGFXcommented, May 18, 2022

You’re right @liamdebeasi , thanks for the info. Refactored it a bit and all is happy with the result. Cheers

0reactions
ionitron-bot[bot]commented, Jun 17, 2022

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 ...
Bug Report Ionic version: [x] 5.x Current behavior: When using a modal with mode: 'ios', the .modal-shadow element prevents clicking the ...
Read more >
Bootstrap modal appearing under background - Stack Overflow
If the modal container has a fixed or relative position or is within an element with fixed or relative position this behavior will...
Read more >
Bootstrap Modal Dialog showing under Modal Background
The above problem occurs when the Modal dialog sits within a container that has any parent that uses either fixed , absolute or...
Read more >
10 Most Common Bootstrap Mistakes That Developers Make
Common Bootstrap Mistake #5: Misusing a modal prompt · Showing more than one modal prompt at the time · Bootstrap modal appears under...
Read more >
Modal - Bootstrap
Modals are built with HTML, CSS, and JavaScript. · Clicking on the modal “backdrop” will automatically close the modal. · Bootstrap only supports...
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