Closed Ploppy3 closed 2 months ago
Since it seems to be an angular limitation, one way to partially solve this would be to give an optional @Input
parameter to delay the destruction of the TinyMce editor in the ngOnDestroy
call.
For reference, here is how a similar issue was fixed by another dev. https://github.com/telerik/kendo-angular/issues/1018#issuecomment-589167663
Might be something that tinymce-angular can handle but I do wonder how. I think we want to avoid delaying the removal of TinyMCE through other means than life cycle hooks (and similar) as I imagine that it easily could lead to bugs. Perhaps this doesn't work for your use case but as a workaround you could take care of conditionally removing tinymce-angular via an animation callback. https://codesandbox.io/s/tinymceangular-lg26p?fontsize=14&hidenavigation=1&theme=dark
To be investigated
@SimonFc even though what you propose works, I don't think it is applicable to router animations.
Edit: as explained in the link above, Angular takes care of clearing the dom, only the javascript object has to be cleared from memory in the onDestroy
life cycle hook. I don't know how TinyMCE was implemented so I'm not sure if it is possible.
I implemented your solution and it indeed does not work for router animations.
This issue is stale because it has been open 30 days with no activity. Please comment if you wish to keep this issue open or it will be closed in 7 days.
This issue is stale because it has been open 30 days with no activity. Please comment if you wish to keep this issue open or it will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
What is the current behavior? Editor breaks when removed from template with animations. It turns into a textarea during the animation. I've tested several of my animations and all break the editor.
Please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox.io or similar.
https://codesandbox.io/s/tinymceangular-6kzby
What is the expected behavior? Editor should not break when animated
Which versions of TinyMCE/TinyMCE-Angular, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE or TinyMCE-Angular? Angular 9 with Ivy TinyMCE-Angular: 3.4.0