diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor-properties.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor-properties.element.ts index ec0fb04c71..9e726ba35b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor-properties.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor-properties.element.ts @@ -91,8 +91,8 @@ export class UmbContentTypeDesignEditorPropertiesElement extends UmbLitElement { return this._containerId; } public set containerId(value: string | null | undefined) { - if (value === this._containerId) return; const oldValue = this._containerId; + if (value === oldValue) return; this._containerId = value; this.#propertyStructureHelper.setContainerId(value); this.#addPropertyModal.setUniquePathValue('container-id', value === null ? 'root' : value); diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts index 2800b5e430..75e6a688d9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts @@ -23,8 +23,8 @@ import { export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { // #dataTypeDetailRepository = new UmbDataTypeDetailRepository(this); - #settingsModal; + #dataTypeUnique?: string; @property({ attribute: false }) public set propertyStructureHelper(value: UmbContentTypePropertyStructureHelper | undefined) { @@ -49,6 +49,7 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { } public set property(value: UmbPropertyTypeModel | UmbPropertyTypeScaffoldModel | undefined) { const oldValue = this._property; + if (value === oldValue) return; this._property = value; this.#checkInherited(); this.#settingsModal.setUniquePathValue('propertyId', value?.id); @@ -141,9 +142,15 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { this._aliasLocked = !this._aliasLocked; } - async #setDataType(dataTypeId: string | undefined) { - if (!dataTypeId) return; - this.#dataTypeDetailRepository.requestByUnique(dataTypeId).then((x) => (this._dataTypeName = x?.data?.name)); + async #setDataType(dataTypeUnique: string | undefined) { + if (!dataTypeUnique) { + this._dataTypeName = undefined; + this.#dataTypeUnique = undefined; + return; + } + if (dataTypeUnique === this.#dataTypeUnique) return; + this.#dataTypeUnique = dataTypeUnique; + this.#dataTypeDetailRepository.requestByUnique(dataTypeUnique).then((x) => (this._dataTypeName = x?.data?.name)); } async #requestRemove(e: Event) {