Prerequisites
Ionic Framework Version
v7.x
Current Behavior
When using an Ionic Dialog, I see that HTML elements are retained after dismissal
Expected Behavior
No detached elements
Steps to Reproduce
npm build example app
- Serve production build artifact (I use
http-server dist)
- Open Chrome devtools, garbage collect, take a heap snapshot
- Open and dismiss dialog a few times
- Garbage collect and take another heap snapshot
- Compare snapshots
- Observe there are many detached HTML elements, with
pair in WeakMap retainers
Code Reproduction URL
https://github.com/aeharding/ionic-modal-leak
Ionic Info
Ionic:
Ionic CLI : 7.1.1 (/Users/aeharding/.nvm/versions/node/v20.8.1/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 7.6.6
Capacitor:
Capacitor CLI : 5.6.0
@capacitor/android : not installed
@capacitor/core : 5.6.0
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : not installed globally
System:
NodeJS : v20.8.1 (/Users/aeharding/.nvm/versions/node/v20.8.1/bin/node)
npm : 10.1.0
OS : macOS Unknown
Additional Information

Prerequisites
Ionic Framework Version
v7.x
Current Behavior
When using an Ionic Dialog, I see that HTML elements are retained after dismissal
Expected Behavior
No detached elements
Steps to Reproduce
npm buildexample apphttp-server dist)pair in WeakMapretainersCode Reproduction URL
https://github.com/aeharding/ionic-modal-leak
Ionic Info
Additional Information