Skip to content

Commit 74de549

Browse files
committed
fix sort bug
1 parent 53efca5 commit 74de549

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class SwipeableItem<T> extends React.PureComponent<Props<T>> {
184184
},
185185
[0]
186186
)
187-
.sort()
187+
.sort((a, b) => a - b)
188188
.map((val, i, arr) => {
189189
return new Value(val);
190190
});
@@ -200,7 +200,7 @@ class SwipeableItem<T> extends React.PureComponent<Props<T>> {
200200
},
201201
[0]
202202
)
203-
.sort()
203+
.sort((a, b) => a - b)
204204
.map((val, i, arr) => {
205205
const isLast = i == arr.length - 1;
206206
const mid = isLast ? val : val + (arr[i + 1] - val) / 2;

0 commit comments

Comments
 (0)