Skip to content

Commit 49735f6

Browse files
committed
front: use deepcopy instead of tosorted function
Signed-off-by: Theo Macron <[email protected]>
1 parent 526fbce commit 49735f6

File tree

1 file changed

+1
-1
lines changed
  • ui-speedspacechart/src/components

1 file changed

+1
-1
lines changed

ui-speedspacechart/src/components/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ export const filterVisibleElements = <T>({
339339
getWeight,
340340
minSpace,
341341
}: VisibilityFilterOptions<T>): T[] => {
342-
const sortedElements = elements.toSorted((a, b) => (getWeight(b) ?? 0) - (getWeight(a) ?? 0));
342+
const sortedElements = [...elements].sort((a, b) => (getWeight(b) ?? 0) - (getWeight(a) ?? 0));
343343
const displayedElements: { element: T; position: number }[] = [];
344344

345345
for (const element of sortedElements) {

0 commit comments

Comments
 (0)