This commit is contained in:
Niels Lyngsø
2024-08-27 15:54:24 +02:00
parent fa5164162d
commit ef022f1eb1
2 changed files with 4 additions and 18 deletions

View File

@@ -81,21 +81,14 @@ export class UmbPropertyEditorUIBlockGridElement
this.observe(
context.dataPath,
(dataPath) => {
// Translate paths for content elements:
// Translate paths for content/settings:
this.#contentDataPathTranslator?.destroy();
if (dataPath) {
// Set the data path for the local validation context:
this.#validationContext.setDataPath(dataPath);
this.#contentDataPathTranslator = new UmbBlockElementDataValidationPathTranslator(this, 'contentData');
}
// Translate paths for settings elements:
this.#settingsDataPathTranslator?.destroy();
if (dataPath) {
// Set the data path for the local validation context:
this.#validationContext.setDataPath(dataPath);
this.#contentDataPathTranslator = new UmbBlockElementDataValidationPathTranslator(this, 'contentData');
this.#settingsDataPathTranslator = new UmbBlockElementDataValidationPathTranslator(this, 'settingsData');
}
},

View File

@@ -139,21 +139,14 @@ export class UmbPropertyEditorUIBlockListElement
this.observe(
context.dataPath,
(dataPath) => {
// Translate paths for content elements:
// Translate paths for content/settings:
this.#contentDataPathTranslator?.destroy();
if (dataPath) {
// Set the data path for the local validation context:
this.#validationContext.setDataPath(dataPath);
this.#contentDataPathTranslator = new UmbBlockElementDataValidationPathTranslator(this, 'contentData');
}
// Translate paths for settings elements:
this.#settingsDataPathTranslator?.destroy();
if (dataPath) {
// Set the data path for the local validation context:
this.#validationContext.setDataPath(dataPath);
this.#contentDataPathTranslator = new UmbBlockElementDataValidationPathTranslator(this, 'contentData');
this.#settingsDataPathTranslator = new UmbBlockElementDataValidationPathTranslator(this, 'settingsData');
}
},