Skip to content

Commit 0b7ed5d

Browse files
committed
make sure to trigger validation system by using super.value
1 parent 3157601 commit 0b7ed5d

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

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

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,14 @@ export class UmbPropertyEditorUIBlockListElement
5454
#contentDataPathTranslator?: UmbBlockElementDataValidationPathTranslator;
5555
#settingsDataPathTranslator?: UmbBlockElementDataValidationPathTranslator;
5656

57-
//#catalogueModal: UmbModalRouteRegistrationController<typeof UMB_BLOCK_CATALOGUE_MODAL.DATA, undefined>;
58-
59-
private _value: UmbBlockListValueModel | undefined = undefined;
60-
6157
#lastValue: UmbBlockListValueModel | undefined = undefined;
6258

6359
@property({ attribute: false })
6460
public override set value(value: UmbBlockListValueModel | undefined) {
6561
this.#lastValue = value;
6662

6763
if (!value) {
68-
this._value = undefined;
64+
super.value = undefined;
6965
return;
7066
}
7167

@@ -74,15 +70,15 @@ export class UmbPropertyEditorUIBlockListElement
7470
buildUpValue.contentData ??= [];
7571
buildUpValue.settingsData ??= [];
7672
buildUpValue.expose ??= [];
77-
this._value = buildUpValue as UmbBlockListValueModel;
73+
super.value = buildUpValue as UmbBlockListValueModel;
7874

79-
this.#managerContext.setLayouts(this._value.layout[UMB_BLOCK_LIST_PROPERTY_EDITOR_SCHEMA_ALIAS] ?? []);
80-
this.#managerContext.setContents(this._value.contentData);
81-
this.#managerContext.setSettings(this._value.settingsData);
82-
this.#managerContext.setExposes(this._value.expose);
75+
this.#managerContext.setLayouts(super.value.layout[UMB_BLOCK_LIST_PROPERTY_EDITOR_SCHEMA_ALIAS] ?? []);
76+
this.#managerContext.setContents(super.value.contentData);
77+
this.#managerContext.setSettings(super.value.settingsData);
78+
this.#managerContext.setExposes(super.value.expose);
8379
}
8480
public override get value(): UmbBlockListValueModel | undefined {
85-
return this._value;
81+
return super.value;
8682
}
8783

8884
@state()
@@ -214,10 +210,10 @@ export class UmbPropertyEditorUIBlockListElement
214210
]).pipe(debounceTime(20)),
215211
([layouts, contents, settings, exposes]) => {
216212
if (layouts.length === 0) {
217-
this._value = undefined;
213+
super.value = undefined;
218214
} else {
219-
this._value = {
220-
...this._value,
215+
super.value = {
216+
...super.value,
221217
layout: { [UMB_BLOCK_LIST_PROPERTY_EDITOR_SCHEMA_ALIAS]: layouts },
222218
contentData: contents,
223219
settingsData: settings,
@@ -227,11 +223,11 @@ export class UmbPropertyEditorUIBlockListElement
227223

228224
// If we don't have a value set from the outside or an internal value, we don't want to set the value.
229225
// This is added to prevent the block list from setting an empty value on startup.
230-
if (this.#lastValue === undefined && this._value === undefined) {
226+
if (this.#lastValue === undefined && super.value === undefined) {
231227
return;
232228
}
233229

234-
context.setValue(this._value);
230+
context.setValue(super.value);
235231
},
236232
'motherObserver',
237233
);

0 commit comments

Comments
 (0)