Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Platforms affected
all
What does this PR do?
fire the onTouchStart prop in carousel
the onTouchStart prop didn't fire in the previous code, which may end in unwanted result.
an online demo here: https://snack.expo.io/@sanglewang/react-native-snap-carousel-demo
in the case, we have two nested vertical scrollview, on android only the outside scroll view can be scrolled. we add a state to control the scrollEnabled prop to hack it. since the onTouchStart prop did not fire in the carousel, the state will never turn to false, and the carousel cannot mannully scroll.
I was wondering why the other event props (onScrollEndDrag, onMomentumScrollEnd etc. ) are fired in the component and the onTouchStart is not. Is there any protential problem i ignored ?
What testing has been done on this change?
Tested features checklist
enableMomentum
)vertical
)activeSlideAlignment
)autoplay
)loop
)ScrollView
/FlatList
carousels (propuseScrollView
)ParallaxImage
componentPagination
component