Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak detaching modal dialog #11664

Open
2 of 6 tasks
nwhittaker opened this issue Mar 4, 2025 · 0 comments
Open
2 of 6 tasks

Memory leak detaching modal dialog #11664

nwhittaker opened this issue Mar 4, 2025 · 0 comments
Labels
0 - new New issues that need assignment. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone needs triage Planning workflow - pending design/dev review.

Comments

@nwhittaker
Copy link
Contributor

nwhittaker commented Mar 4, 2025

Check existing issues

Actual Behavior

A <calcite-dialog> element with modal enabled remains in memory after detaching it from the DOM.

Expected Behavior

Modal dialogs are garbage collected after detaching from the DOM.

Reproduction Sample

https://codepen.io/nwhittaker-esri/pen/jEOBjmX

Reproduction Steps

Assuming Chrome 133.

  1. Visit the sample and open devtools.
  2. Click the Toggle dialog switch twice.
  3. Navigate to the Memory tab in devtools.
  4. Under Select JavaScript VM instance, select "cdpn.io: jEOBjmX".
  5. Take a heap snapshot and search for "dialog" and see an entry for "Detached <calcite-dialog>".
  6. Optionally set dialog.modal = false before creating/destroying the dialog. Dumping the heap again should show no <calcite-dialog> element is retained.

Reproduction Version

3.0.3

Relevant Info

Possibly similar to #11668.

Regression?

No response

Priority impact

impact - p2 - want for an upcoming milestone

Impact

This issue impacts a complex component that is likely to be attached/detached frequently. The component is slated for the spring release.

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/calcite-ui-icons
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Field Apps

@nwhittaker nwhittaker added 0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. needs triage Planning workflow - pending design/dev review. labels Mar 4, 2025
@github-actions github-actions bot added ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone labels Mar 4, 2025
@nwhittaker nwhittaker changed the title Memory leak in modal dialog Memory leak detaching modal dialog Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone needs triage Planning workflow - pending design/dev review.
Projects
None yet
Development

No branches or pull requests

1 participant