leecade / leecade/react-native-swiper
Flickering issue still persists with the latest version 1.6.0 when loop={true}.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.5k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Flickering issue still persists even with the latest version 1.6.0. Using the Swiper component with horizontal as false to have vertical swipes -
<Swiper ref={viewPagerRef} index={postDetailsRef?.current?.postIndex} horizontal={false} showsPagination={false} scrollEventThrottle={16}
bounces={true} loop removeClippedSubviews onMomentumScrollBegin={(event) => {
if (optionsState.isImageLoadError) {
setImageLoadError(optionsState, setOptionsState, false);
}
postDetailsRef?.current?.setPostAnimationVisible(true);
}}
onMomentumScrollEnd={(event) => onSwiperScrollEnd(event, postDetailsRef, textPostDescriptionAnimationValue_translate_x, textPostTypeAnimationValue_translate_x)}
onScroll={(event) => {
resetAnimatePostTextDetails(textPostDescriptionAnimationValue_translate_x,
textPostTypeAnimationValue_translate_x);
//onPostScrollFunction(event);
}} />
- When
loop={true}this flickerring occurs on the first and the last view. - Adding
removeClippedSubviews={false}does not fix the issue as our project uses FastImage that caches the images -
<FastImage style={[{ width: width, height: height }]} source={{ uri: item.postImage, priority: FastImage.priority.high, cache: FastImage.cacheControl.immutable }} fallback={optionsState.isImageLoadError} onLoadEnd={() => scrollWhenPostIdFromNotification(sdomDatastate, postIdFromNotification, viewPagerRef, postDetailsRef)} onError={() => setImageLoadError(optionsState, setOptionsState, true)} /> - react-native-snap-carousal also has similar issue when implemented with vertical option enabled.
Please suggest a solution as this is very important to us.Should we proceed with custom impl? If so any links or videos present?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided Swiper configuration: vertical mode, loop enabled, and the first and last views; compare behavior with removeClippedSubviews={false}. Review the Swiper component's loop handling and the mentioned FastImage integration, then compare with react-native-snap-carousel's vertical behavior. Done means the first and last views no longer flicker in this setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100