Skip to content

Commit 437fcba

Browse files
fix: store first rte value (#17699)
1 parent 8141b6b commit 437fcba

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

src/Umbraco.Web.UI.Client/src/packages/tiny-mce/property-editors/tiny-mce/property-editor-ui-tiny-mce.element.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,22 @@ export class UmbPropertyEditorUITinyMceElement extends UmbPropertyEditorUiRteEle
4545

4646
this._latestMarkup = markup;
4747

48-
this._value = this._value
49-
? {
50-
...this._value,
51-
markup: markup,
52-
}
53-
: undefined;
48+
if (this.value) {
49+
this.value = {
50+
...this.value,
51+
markup: this._latestMarkup,
52+
};
53+
} else {
54+
this.value = {
55+
markup: this._latestMarkup,
56+
blocks: {
57+
layout: {},
58+
contentData: [],
59+
settingsData: [],
60+
expose: [],
61+
},
62+
};
63+
}
5464

5565
this._fireChangeEvent();
5666
}

src/Umbraco.Web.UI.Client/src/packages/tiptap/property-editors/tiptap/property-editor-ui-tiptap.element.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,22 @@ export class UmbPropertyEditorUiTiptapElement extends UmbPropertyEditorUiRteElem
4040

4141
this._latestMarkup = value;
4242

43-
this._value = this._value
44-
? {
45-
...this._value,
46-
markup: this._latestMarkup,
47-
}
48-
: undefined;
43+
if (this.value) {
44+
this.value = {
45+
...this.value,
46+
markup: this._latestMarkup,
47+
};
48+
} else {
49+
this.value = {
50+
markup: this._latestMarkup,
51+
blocks: {
52+
layout: {},
53+
contentData: [],
54+
settingsData: [],
55+
expose: [],
56+
},
57+
};
58+
}
4959

5060
this._fireChangeEvent();
5161
}

0 commit comments

Comments
 (0)