Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No animation in iterativeAPI #11

Open
SumitLubal opened this issue Oct 6, 2022 · 2 comments
Open

No animation in iterativeAPI #11

SumitLubal opened this issue Oct 6, 2022 · 2 comments

Comments

@SumitLubal
Copy link

I am loving this library and for our project it is very improtant to have iterative api usage for those with accessibility so they can touch instead of drag.
incrementPage works beautifully but doesn't show any animation in scrolling. Any idea how we can add this?

@nicolaosm
Copy link
Contributor

Any updates on this? Cant use the lib without it. Thanks

@levymetal
Copy link

This can be achieved by setting animated: true in the optional options arg. For example:

const App = () => {
  const pagerRef = useRef<InfinitePagerImperativeApi>(null);

  const incrementPage = () => {
    pagerRef.current?.incrementPage({animated: true})
  }

  const setPage = (index: number) => {
    pagerRef.current?.setPage(index, {animated: true})
  }

  return (
    <Pager ref={pagerRef} renderPage={() => <View />} />
  );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants