When swiping item, they stop in the middle
See original GitHub issueHello everyone,
There are some issues on some Android devices. Slider can’t move full next one.
This is my code:
const carouselRef = useRef<Carousel<{uri: string}>>(null);
const SLIDER_WIDTH = Dimensions.get('window').width;
const [index, setIndex] = React.useState(0);
const _goToGallery = () => {
navigation.navigate('PropertyDetailGallery');
};
const _renderItem = ({item}: {item: string}) => (
<Pressable style={PropertyDetailStyles.carouselCard} onPress={_goToGallery}>
<ImageIndicator source={item} style={PropertyDetailStyles.image} />
</Pressable>
);
const _onSnapToItem = (index: number) => setIndex(index);
return (
<>
<ButtonArrow
onPress={goBack}
containerStyle={PropertyDetailStyles.backButton}
/>
<Carousel
removeClippedSubviews
/* @ts-ignore */
ref={carouselRef}
data={imageList}
renderItem={_renderItem}
sliderWidth={SLIDER_WIDTH}
itemWidth={SLIDER_WIDTH}
onSnapToItem={_onSnapToItem}
/>
<Pagination
dotsLength={imageList.length}
activeDotIndex={index}
containerStyle={PropertyDetailStyles.carouselPagination}
dotContainerStyle={PropertyDetailStyles.carouselDotContainer}
dotStyle={PropertyDetailStyles.carouselDot}
dotColor={BLACK_COLOR}
inactiveDotColor={FIFTH_GREY}
inactiveDotScale={1}
tappableDots={true}
/* @ts-ignore */
carouselRef={carouselRef}
/>
</>
);
Do you meet this issue? Is there any way to resolve it? Thank you.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:17
Top Results From Across the Web
How can RecyclerView ItemTouchHelper lock swipe item?
Then, when you release you see the item starting from the middle again because the real dX you receive is still pointing to...
Read more >Understanding swipe and drag gestures in RecyclerView
We initialized our ItemTouchHelper with an object of the same. It takes 2 parameters viz. dragDirs and swipeDirs . For the former, we...
Read more >Gesture, swipe, and press to navigate your iPhone 13 and ...
Use gestures on your iPhone with Face ID to quickly navigate, multitask, adjust settings, and access all the things you do most.
Read more >Android RecyclerView Swipe to Delete and Undo ... - YouTube
In this video I show you how to implement swipe to delete on a recyclerview, with an icon and background to indicated deletion...
Read more >Use your Chromebook touchpad - Google Support
Here's how it works: ... To close it, swipe down with three fingers. ... the item you want to move. Drag the item...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
4.0.0-beta6
For anyone struggling with this, there is a
.
before the beta number. Without this, the install command will fail @fengjueji @geovrisconpm i react-native-snap-carousel@4.0.0-beta.6
You can find this out for yourself by doing:
npm view react-native-snap-carousel
and checking thedist-tags
at the bottom.