We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3b3ea9 commit 279279fCopy full SHA for 279279f
src/libs/observable-api/states/array-state.ts
@@ -35,7 +35,10 @@ export class UmbArrayState<T> extends UmbDeepState<T[]> {
35
*/
36
sortBy(sortMethod?: (a: T, b: T) => number) {
37
this.#sortMethod = sortMethod;
38
- super.setValue([...this.getValue()].sort(this.#sortMethod));
+ const value = this.getValue();
39
+ if(value) {
40
+ super.setValue([...value].sort(this.#sortMethod));
41
+ }
42
return this;
43
}
44
0 commit comments