#1136 update rte when value changes
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user