Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Editor initialization failure error handling. #INT-3366
- Disconnected Editor not destroyed.

## 2.3.1 - 2025-08-11

Expand Down
3 changes: 3 additions & 0 deletions src/main/ts/component/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ class TinyMceEditor extends HTMLElement {
disconnectedCallback(): void {
this._mutationObserver.disconnect();
this._updateForm();
if (this._editor) {
this._getTinymce().remove(this._editor);
}
}

get value(): string | null {
Expand Down
9 changes: 7 additions & 2 deletions src/test/ts/browser/LoadTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@ UnitTest.asynctest('LoadTest', (success, failure) => {
}),
Step.sync(() => makeTinymceElement({
'setup': 'customElementTinymceSetup',
'on-init': 'customElementTinymceInit'
'on-init': 'customElementTinymceInit',
'id': 'example_id'
}, '<p>Hello world</p>')),
Waiter.sTryUntilPredicate('Waiting for editor setup', () => seenSetup),
Waiter.sTryUntilPredicate('Waiting for editor init', () => seenInit),
Step.sync(() => {
Assertions.assertHtmlStructure('', '<p>Hello world</p>', editorInstance.getContent() as string);
Assertions.assertEq('An editor instance is registered', true, Global.tinymce.get('example_id') !== null);
}),
Step.sync(() => removeTinymceElement())
Step.sync(() => removeTinymceElement()),
Step.sync(() => {
Assertions.assertEq('The editor instance is removed', true, Global.tinymce.get('example_id') === null);
})
], success, failure);
});
Loading