Open shay-te opened 2 years ago
ANDROID
1.6.0
When using scrollBy with value 0 to go to the first panel. The transition should be done smoothly
scrollBy
0
On Android, the photo flickers when moving back to 0
on IOS the transition is smooth.
HOWEVER, When passing the second parameter animated as true IOS + ANDROID: Will does not scroll to location 0at all
animated
true
var [photos, setPhotos] = useState([]); useEffect(function() { var photos = []; for(var i = 0 ; i < props.profile.photos.length ; i++) { photos.push( <Pressable onPress={onPhotoClick.bind(this, i)} style={styles.slide} key={props.profile.photos[i]} onStartShouldSetResponder={() => true}> <ImageLoading style={styles.photo} resizeMode='contain' source={{uri: props.profile.photos[i]}}>{renderProgress()}</ImageLoading> </Pressable> ); } setPhotos(photos); }, [props.profile]); setPhotos(photos); function onPhotoClick(i) { if (swiperRef.current) { swiperRef.current.scrollBy(i < photos.length ? i+1 : 0); } } .... <Swiper ref={swiperRef} showsPagination={true} horizontal={false} showsButtons={false} onIndexChanged={onPhotoVisited} dotColor={constants.COLOR_GREY_30} activeDotColor={isCompleted ? constants.COLOR_GOLD : constants.COLOR_WHITE}> {photos} </Swiper>
-
Run this code and click the photo
Which OS?
ANDROID
Version
1.6.0
Expected behavior
When using
scrollBy
with value0
to go to the first panel. The transition should be done smoothlyActual behavior
On Android, the photo flickers when moving back to
0
Aditional info.
on IOS the transition is smooth.
HOWEVER, When passing the second parameter
animated
astrue
IOS + ANDROID: Will does not scroll to location0
at allHow to reproduce it>
-
Steps to reproduce
Run this code and click the photo