I have a timesheet grid where we need to support rich text comments for each cell in my application. We use a textarea element that is bound to a CKEditor control for rich text format in a form that is outside of the grid for our application.
When a cell of the grid gets focus, I use a setData call to set the current comment text for that particular cell that has focus. If I hold down the tab key in the grid, this rapidly fires setData methods on the CKEditor control as the focus changes from cell to cell. I found that holding down the tab key causes a major memory leak due to the setData calls. If I comment out the setData calls the memory leak goes away. Also, if I tab slower (wait 1 second between hitting the tab key), I do not see the memory leak. I see that there was a related case opened a few years ago related to this but it seems to still be a problem.
I tried passing different options to the setData call to avoid snapshots or simulate an internal call but that did nto seem to help. Would appreciate any advice on this issue. Testing using Chrome on a PC (version 35.0.1916.153). Thanks.
Work Around
I have found a work around. If I add a small timeout before calling setData it seems to resolve the issue. Something like:
clearTimeout(myTimeout);
myTimeout = setTimeout(function() {
editor.setData(text);
}, 100);
So it looks like it is just due to the setData calls coming too quickly.