destroy active editor when component is removed

This commit is contained in:
Nathan Woulfe
2023-06-21 14:58:52 +10:00
parent 184c27212a
commit 217aeeb617

View File

@@ -70,11 +70,15 @@ export class UmbInputTinyMceElement extends FormControlMixin(UmbLitElement) {
async connectedCallback() {
super.connectedCallback();
await this.#loadPlugins();
this.#setTinyConfig();
}
disconnectedCallback() {
super.disconnectedCallback();
tinymce.default.activeEditor?.destroy();
}
/**
* Load all custom plugins - need to split loading and instantiating as these
* need the editor instance as a ctor argument. If we load them in the editor