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

How disable onPress on image - when swiping carousel ? #488

Open
Murena7 opened this issue Mar 3, 2019 · 4 comments
Open

How disable onPress on image - when swiping carousel ? #488

Murena7 opened this issue Mar 3, 2019 · 4 comments

Comments

@Murena7
Copy link

Murena7 commented Mar 3, 2019

Hi all , how i can disable onPress when user swiping carousel ? Just now when user swiping - he can onPress on image, but i want disable possibility onPress on carousel image when user swiping between images, but if user fast onPress without swiping - i want trigger onPress event. How can i do this ? Thanks

@tuvudu
Copy link

tuvudu commented Nov 14, 2019

you should try add Touchable component swap item in renderItems props of carousel

@xcarpentier
Copy link

Hi @Murena7

Do you find any workaround?

cc @tuvudu @bd-arc

@bd-arc
Copy link
Contributor

bd-arc commented Nov 19, 2020

With v3 you can use prop lockScrollWhileSnapping.

With v4 you probably need to change scrollEnabled prop's value based on onScroll and onSnapToItem. In that case, I recommend doing it with setNativeProps() rather than with a state update to avoid unresponsiveness. Here's an example.

@dohooo

This comment was marked as spam.

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

5 participants