Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v8.x
Current Behavior
When opening an ion-modal inline, if the parent component gets destroyed when the modal is open, the modal is not dismissed nor destroyed
Expected Behavior
The modal should close when the parent component is destroyed
Steps to Reproduce
- Create an inline
ion-modal
inside a child-component - Destroy the Child component (
ngIf
or similar)
Code Reproduction URL
https://stackblitz.com/edit/tmgkbwps
Ionic Info
Ionic:
Ionic CLI : 7.2.0
Ionic Framework : @ionic/angular 8.5.6
@angular-devkit/build-angular : 19.2.6
@angular-devkit/schematics : 19.2.6
@angular/cli : 19.2.6
@ionic/angular-toolkit : 11.0.1
Capacitor:
Capacitor CLI : 7.2.0
@capacitor/android : 7.2.0
@capacitor/core : 7.2.0
@capacitor/ios : not installed
Cordova:
Cordova CLI : not installed
Cordova Platforms : not available
Cordova Plugins : not available
Utility:
cordova-res : not installed globally
native-run : 2.0.1
System:
NodeJS : v20.18.3 (/Users/me/.volta/tools/image/node/20.18.3/bin/node)
npm : 10.8.2
OS : macOS Unknown
Additional Information
I have not found any workaround for this besides use some flag inside the parent component to "render the content", which is dangerous since we can not prevent a regular Angular if
usage in the future.
Metadata
Metadata
Assignees
Type
Projects
Status