#1136 update rte when value changes

This commit is contained in:
Markus Johansson
2024-01-22 00:01:55 +01:00
parent 98a191426f
commit 100ac12840

View File

@@ -42,6 +42,19 @@ export class UmbInputTinyMceElement extends FormControlMixin(UmbLitElement) {
return this._editorElement?.querySelector('iframe') ?? undefined;
}
set value(newValue: FormDataEntryValue | FormData) {
this._value = newValue;
const newContent = newValue?.toString() ?? '';
if(this.#editorRef && this.#editorRef.getContent() != newContent) {
this.#editorRef.setContent(newContent);
}
}
get value(): FormDataEntryValue | FormData {
return this._value;
}
@query('#editor', true)
private _editorElement?: HTMLElement;