From df9497a114a1670af0d0da3720308bdbcf5d4124 Mon Sep 17 00:00:00 2001 From: Zero Date: Wed, 27 Aug 2025 08:46:53 +0200 Subject: [PATCH] fix: cursor jumping while editing and external update --- .../src/main/ts/editor/editor.component.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tinymce-angular-component/src/main/ts/editor/editor.component.ts b/tinymce-angular-component/src/main/ts/editor/editor.component.ts index 5ddf6c3a..bba0dcf5 100644 --- a/tinymce-angular-component/src/main/ts/editor/editor.component.ts +++ b/tinymce-angular-component/src/main/ts/editor/editor.component.ts @@ -123,13 +123,11 @@ export class EditorComponent extends Events implements AfterViewInit, ControlVal } public writeValue(value: string | null): void { - if (this._editor && this._editor.initialized) { - this._editor.setContent(isNullOrUndefined(value) ? '' : value); - } else { + if (!this._editor || !this._editor.initialized) { this.initialValue = value === null ? undefined : value; } } - + public registerOnChange(fn: (_: any) => void): void { this.onChangeCallback = fn; }