Open AdamGerthel opened 2 years ago
Update: The typescript annotation is actually wrong for next
and prev
too. It says (opts?: Omit<TCarouselActionOptions, 'index'>)
which seems incorrect since it takes a number parameter.
I'm running into this on v3.0.5 as well. The carousel progresses toward the index, but only makes it about halfway. In other words, if I'm on index 2 and try to scroll to index 1 or 0, the carousel progresses to index 1. If I'm on index 3 and try to scroll to index 0, it scrolls to index 1
After more testing, it seems to work fine when animated
is false, but not when animated
is true
ref?.current?.scrollTo({
index: 1,
animated: true,
});
Have the same issue as @akshy78695, can confirm it only happens when animated: true
. Please fix this
Describe the bug
ICarouselInstance.scrollTo
has a TS declaration which doesn't seem to match the documentation. According to TypeScript,scrollTo
accepts aTCarouselActionOptions
, but according to the documentation, it expects a number:I've tried using a number, and that didn't work as expected. I've also tried passing an object with an index,
{ index: 1 }
(or equivalent). But neither works as expected.Expected behavior I expect
scrollTo
to take a number as parameter as described in the JS comment.Versions (please complete the following information):