Skip to content

Commit ac8c06f

Browse files
committed
fix: ensure numeric sorting for snapPoints
1 parent b537d42 commit ac8c06f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/composables/useSnapPoints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { computed, type Ref } from 'vue'
22

33
export function useSnapPoints(snapPoints: Ref<number[]>, height: Ref<number>) {
4-
const sortedSnapPoints = computed(() => snapPoints.value.sort())
4+
const sortedSnapPoints = computed(() => snapPoints.value.sort((a, b) => a - b))
55

66
const minSnap = computed(() => sortedSnapPoints.value[0])
77
const maxSnap = computed(() => sortedSnapPoints.value[sortedSnapPoints.value.length - 1])

0 commit comments

Comments
 (0)