fix: store first rte value (#17699)

This commit is contained in:
Mads Rasmussen
2024-12-02 21:23:39 +01:00
committed by GitHub
parent 8141b6b07e
commit 437fcba4e5
2 changed files with 32 additions and 12 deletions

View File

@@ -45,12 +45,22 @@ export class UmbPropertyEditorUITinyMceElement extends UmbPropertyEditorUiRteEle
this._latestMarkup = markup;
this._value = this._value
? {
...this._value,
markup: markup,
}
: undefined;
if (this.value) {
this.value = {
...this.value,
markup: this._latestMarkup,
};
} else {
this.value = {
markup: this._latestMarkup,
blocks: {
layout: {},
contentData: [],
settingsData: [],
expose: [],
},
};
}
this._fireChangeEvent();
}

View File

@@ -40,12 +40,22 @@ export class UmbPropertyEditorUiTiptapElement extends UmbPropertyEditorUiRteElem
this._latestMarkup = value;
this._value = this._value
? {
...this._value,
markup: this._latestMarkup,
}
: undefined;
if (this.value) {
this.value = {
...this.value,
markup: this._latestMarkup,
};
} else {
this.value = {
markup: this._latestMarkup,
blocks: {
layout: {},
contentData: [],
settingsData: [],
expose: [],
},
};
}
this._fireChangeEvent();
}