Skip to content

Commit c3b3ea9

Browse files
committed
make mutable array before sorting
1 parent f562985 commit c3b3ea9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/libs/observable-api/states/array-state.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class UmbArrayState<T> extends UmbDeepState<T[]> {
3535
*/
3636
sortBy(sortMethod?: (a: T, b: T) => number) {
3737
this.#sortMethod = sortMethod;
38-
super.setValue(this.getValue().sort(this.#sortMethod));
38+
super.setValue([...this.getValue()].sort(this.#sortMethod));
3939
return this;
4040
}
4141

@@ -51,7 +51,7 @@ export class UmbArrayState<T> extends UmbDeepState<T[]> {
5151
*/
5252
override setValue(value: T[]) {
5353
if (this.#sortMethod) {
54-
super.setValue(value.sort(this.#sortMethod));
54+
super.setValue([...value].sort(this.#sortMethod));
5555
} else {
5656
super.setValue(value);
5757
}

src/packages/block/block-list/property-editors/block-list-editor/manifests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { manifest as blockListSchemaManifest } from './Umbraco.BlockList.js';
21
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';
2+
import { manifest as blockListSchemaManifest } from './Umbraco.BlockList.js';
33

44
export const UMB_BLOCK_LIST_PROPERTY_EDITOR_ALIAS = 'Umbraco.BlockList';
55

0 commit comments

Comments
 (0)