diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property-action/shared/property-action-menu/property-action-menu.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/property-action/shared/property-action-menu/property-action-menu.element.ts index b8af412389..34b786cca7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/property-action/shared/property-action-menu/property-action-menu.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/property-action/shared/property-action-menu/property-action-menu.element.ts @@ -10,24 +10,25 @@ import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; @customElement('umb-property-action-menu') export class UmbPropertyActionMenuElement extends UmbLitElement { #actionsInitializer?: UmbExtensionsElementInitializer; + #value: unknown; + #propertyEditorUiAlias = ''; @property({ attribute: false }) public set value(value: unknown) { - this._value = value; + this.#value = value; if (this.#actionsInitializer) { this.#actionsInitializer.properties = { value }; } } public get value(): unknown { - return this._value; + return this.#value; } - private _value?: unknown; - - #propertyEditorUiAlias = ''; - @property() set propertyEditorUiAlias(alias: string) { + // If there is an existing initializer, we need to dispose it. + this.#actionsInitializer?.destroy(); + this.#propertyEditorUiAlias = alias; // TODO: Stop using string for 'propertyAction', we need to start using Const. // TODO: Align property actions with entity actions. @@ -47,7 +48,7 @@ export class UmbPropertyActionMenuElement extends UmbLitElement { } @state() - private _actions: Array> = []; + private _actions: Array> = []; render() { return this._actions.length > 0