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

Virtualize: onSwitching called with wrong index #646

Closed
1 task done
meowtec opened this issue Jun 21, 2021 · 0 comments · Fixed by #647
Closed
1 task done

Virtualize: onSwitching called with wrong index #646

meowtec opened this issue Jun 21, 2021 · 0 comments · Fixed by #647

Comments

@meowtec
Copy link
Contributor

meowtec commented Jun 21, 2021

I am writing a coverflow component with infinite loop. So I use the onSwitching API combined with the Virtualize HOC, but it
got wrong index value.

const VirtualizeSwipeableViews = virtualize(SwipeableViews);
<VirtualizeSwipeableViews
  slideRenderer={() => <div />}
  onSwitching={(index) => console.log(index)}
/>
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

index should increase when swiping to the right

Current Behavior

index always be between 2 to 4

Steps to Reproduce (for bugs)

Context

Your Environment

Tech Version
react-swipeable-views
React
platform
etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant