We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 526fbce commit 49735f6Copy full SHA for 49735f6
ui-speedspacechart/src/components/utils.ts
@@ -339,7 +339,7 @@ export const filterVisibleElements = <T>({
339
getWeight,
340
minSpace,
341
}: VisibilityFilterOptions<T>): T[] => {
342
- const sortedElements = elements.toSorted((a, b) => (getWeight(b) ?? 0) - (getWeight(a) ?? 0));
+ const sortedElements = [...elements].sort((a, b) => (getWeight(b) ?? 0) - (getWeight(a) ?? 0));
343
const displayedElements: { element: T; position: number }[] = [];
344
345
for (const element of sortedElements) {
0 commit comments