diff --git a/src/Umbraco.Web.UI.Client/src/libs/observable-api/states/array-state.ts b/src/Umbraco.Web.UI.Client/src/libs/observable-api/states/array-state.ts index c31a4d98a7..57adf7f0a1 100644 --- a/src/Umbraco.Web.UI.Client/src/libs/observable-api/states/array-state.ts +++ b/src/Umbraco.Web.UI.Client/src/libs/observable-api/states/array-state.ts @@ -35,7 +35,10 @@ export class UmbArrayState extends UmbDeepState { */ sortBy(sortMethod?: (a: T, b: T) => number) { this.#sortMethod = sortMethod; - super.setValue(this.getValue().sort(this.#sortMethod)); + const value = this.getValue(); + if(value) { + super.setValue([...value].sort(this.#sortMethod)); + } return this; } @@ -51,7 +54,7 @@ export class UmbArrayState extends UmbDeepState { */ override setValue(value: T[]) { if (this.#sortMethod) { - super.setValue(value.sort(this.#sortMethod)); + super.setValue([...value].sort(this.#sortMethod)); } else { super.setValue(value); } diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block-list/property-editors/block-list-editor/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block-list/property-editors/block-list-editor/manifests.ts index c3d07105cc..bbb50aafbc 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block-list/property-editors/block-list-editor/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block-list/property-editors/block-list-editor/manifests.ts @@ -1,5 +1,5 @@ -import { manifest as blockListSchemaManifest } from './Umbraco.BlockList.js'; import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; +import { manifest as blockListSchemaManifest } from './Umbraco.BlockList.js'; export const UMB_BLOCK_LIST_PROPERTY_EDITOR_ALIAS = 'Umbraco.BlockList';