Posted 19 February 2024, 2:32 pm EST
We are using FlexGrid with Angular 17, and we’re experiencing detached DOM elements after navigating away from the grid to other parts of the application. These are causing memory leaks for us.
Our integration is quite complex and there are a lot of moving parts. We have found and fixed several points of listener registration that was resulting in object retainers preventing GC. This has made things a bit better but hasn’t solved the fundamental issue.
I’ve taken a step back to try and produce a more minimal example, and this example itself seems to produce a bunch of detached DOM nodes, quite possibly because I am doing the wrong thing or because I am missing steps in proper disposal.
Here is the example: https://jscodemine.mescius.io/sample/IakIcWjo_UWakAgvpJEDFA/
What I have found in our integration is that there are some hanging listeners that appear to be created by Wijmo and that are not disposed. In particular there seems to be a ‘load’ listener attached to the window that is never removed, but I don’t really know what is going on here. We also seem to have hanging listeners for ‘keydown’, ‘keypress’, ‘compositionstart’ and ‘compositionend’.
Can you provide any advice or insight into what might be going on here and what we should be doing to properly dispose of the grid? Are there any listener deregistration bugs within Wijmo itself that might be contributing to our headaches?
Thank you in advance.