Skip to content

Commit 4af36cd

Browse files
authored
Merge pull request #199 from LeviWilliams/main
Fix scrollTo 0 index bug
2 parents 573a19e + a4ff9da commit 4af36cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hooks/useCarouselController.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export function useCarouselController(options: IOpts): ICarouselController {
256256
(opts: TCarouselActionOptions = {}) => {
257257
const { index: i, count, animated = false, onFinished } = opts;
258258

259-
if (i) {
259+
if (typeof i === 'number' && i > -1) {
260260
to({ i, animated, onFinished });
261261
return;
262262
}

0 commit comments

Comments
 (0)