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

onProgressChange & onSnapToItem bug when only 2 image #74

Closed
hotaryuzaki opened this issue Jan 5, 2022 · 6 comments · Fixed by #78
Closed

onProgressChange & onSnapToItem bug when only 2 image #74

hotaryuzaki opened this issue Jan 5, 2022 · 6 comments · Fixed by #78
Assignees
Labels
bug Something isn't working

Comments

@hotaryuzaki
Copy link

hotaryuzaki commented Jan 5, 2022

onProgressChange & onSnapToItem bug when only 2 image, index item slide from 0-3 (detect as 4 images)
you can reproduce set only 2 images and console log onSnapToItem or onProgressChange absoluteProgress
onSnapToItem={(index) => console.log(index)}
onProgressChange={(offsetProgress, absoluteProgress) => console.log(absoluteProgress)}

this makes my slider indicator not works as expected when index is 3.

@dohooo
Copy link
Owner

dohooo commented Jan 5, 2022

what version are you using?
I’ll try it ASAP

@dohooo
Copy link
Owner

dohooo commented Jan 5, 2022

Thanks for the tip

@dohooo
Copy link
Owner

dohooo commented Jan 5, 2022

https://discord.gg/KsXRuDs43y
join in the chat room so u can get notifications more quickly

@hotaryuzaki
Copy link
Author

my workaround

onProgressChange={(offsetProgress, absoluteProgress) => {
    if (data.length === 2 && absoluteProgress >= 2) {
        progressValue.value = absoluteProgress - 2;
    } else progressValue.value = absoluteProgress;
}}

@dohooo dohooo self-assigned this Jan 5, 2022
@dohooo dohooo added the bug Something isn't working label Jan 5, 2022
@dohooo dohooo linked a pull request Jan 5, 2022 that will close this issue
@dohooo
Copy link
Owner

dohooo commented Jan 5, 2022

1.2.0-beta.3

@dohooo dohooo closed this as completed Jan 5, 2022
@hotaryuzaki
Copy link
Author

hotaryuzaki commented Jan 19, 2022

i upgrade to 2.2.1 and bug still occur

onProgressChange={(offsetProgress, absoluteProgress) => console.log(absoluteProgress)}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants