You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When pass data with less than or equal 2 items (for ex: ['item 0', 'item 1'], ['item 0'] ). In case 1 item, onSnapToItem return index 0 1 2. In case 2 items it return 0 1 2 3. In case > 2 items, it work perfectly. I guess if data not enough 3 item, you add 2 item outside for loop scroll purpose. If true, could you find another way to complete loop logic or re-calculate index in specific case because index is very important to me.
To Reproduce
Pass data with less or equal than 2 item and log index in onSnapToItem
Expected behavior
return true index
Screenshots
Versions (please complete the following information):
react: v17.0.2
react-native: v0.67.2
react-native-reanimated: v2.4.1
react-native-reanimated-carousel: v2.3.4
react-native-gesture-handler: v2.2.0
Smartphone (please complete the following information):
Device: simulator iPhone 12
OS: iOS 14.5
Thank you.
The text was updated successfully, but these errors were encountered:
hminhman
changed the title
Wrong index in onSnapToItem when pass data with less than 2 item
Wrong index in onSnapToItem when pass data with less or equal than 2 item
Apr 20, 2022
Describe the bug
When pass data with less than or equal 2 items (for ex: ['item 0', 'item 1'], ['item 0'] ). In case 1 item, onSnapToItem return index 0 1 2. In case 2 items it return 0 1 2 3. In case > 2 items, it work perfectly. I guess if data not enough 3 item, you add 2 item outside for loop scroll purpose. If true, could you find another way to complete loop logic or re-calculate index in specific case because index is very important to me.
To Reproduce
Pass data with less or equal than 2 item and log index in onSnapToItem
Expected behavior
return true index
Screenshots
Versions (please complete the following information):
Smartphone (please complete the following information):
Thank you.
The text was updated successfully, but these errors were encountered: