leecade / react-native-swiper

The best Swiper component for React Native.
MIT License
10.4k stars 2.34k forks source link

Swiper cuts off after state update on another page #1215

Open kchangch opened 4 years ago

kchangch commented 4 years ago
Screen Shot 2020-08-24 at 11 24 13 AM

After I swipe to the second page, if a state update occurs on the previous page, the current page gets drifted to the left. Is there any solution to this issue?

slolkunchik commented 4 years ago

the same problem - if I like the page and state updates, the screen changes the page on another one, but pagination stays the same. Then I swipe and see on the same pagination necessary liked screen. So once again, pagination stays the same. And then if there no more state updates, the swiper works as usual. That's just on ios, android works properly.

kchangch commented 4 years ago

Is there any solution to this issue?

frasermince commented 4 years ago

I just ran into this issue too and fixed it by using the current master ref in my package.json. Looks like this is fixed in master!

kchangch commented 4 years ago

Can you expand on changing the ref to master? Sorry i'm quiet new to this

frasermince commented 4 years ago

Sure! In my package.json I changed: "react-native-swiper": "^1.6.0", to "react-native-swiper": "https://github.com/leecade/react-native-swiper#5827a80002738abd1c0dc08428303c79bbc840c0",

kwameaj67 commented 3 years ago

Sure! In my package.json I changed: "react-native-swiper": "^1.6.0", to "react-native-swiper": "https://github.com/leecade/react-native-swiper#5827a80002738abd1c0dc08428303c79bbc840c0",

still doesn't work

ValerianThomas commented 3 years ago

Hi Guys, I have encounter the same issue. Any updates ?

QAQmmttyyy commented 3 years ago

same issue #1171

1174 Please try this. Actually it's already fixed, but missed in the 1.6.0 release.

QAQmmttyyy commented 3 years ago

@

same issue #1171

1174 Please try this. Actually it's already fixed, but missed in the 1.6.0 release.

@kchangch

mohity7777 commented 3 years ago

when is this thing going to get updated ??

QAQmmttyyy commented 3 years ago

@skv-headless @mohity7777 Look at the comment.

  renderScrollView = pages => {
    return (
      <ScrollView
        ref={this.refScrollView}
        {...this.props}
        {...this.scrollViewPropOverrides()}
        contentContainerStyle={[styles.wrapperIOS, this.props.style]}
        // try remove this line. or sync the state.offset with internal.offset.
        // contentOffset={this.state.offset}
        onScrollBeginDrag={this.onScrollBegin}
        onMomentumScrollEnd={this.onScrollEnd}
        onScrollEndDrag={this.onScrollEndDrag}
        style={this.props.scrollViewStyle}
      >
        {pages}
      </ScrollView>
    )
  }
mohity7777 commented 3 years ago

Actually doing the changes in node modules solved my issue. I just meant that why is this not there in latest release ?

nerdic-coder commented 3 years ago

Sure! In my package.json I changed: "react-native-swiper": "^1.6.0", to "react-native-swiper": "https://github.com/leecade/react-native-swiper#5827a80002738abd1c0dc08428303c79bbc840c0",

This solved it for me. Thank you! They should really publish this as an 1.6.1, since this seems to be a common issue.

kckunal2612 commented 2 years ago

Sure! In my package.json I changed: "react-native-swiper": "^1.6.0", to "react-native-swiper": "https://github.com/leecade/react-native-swiper#5827a80002738abd1c0dc08428303c79bbc840c0",

Thank you, this was a life-saver!

davemannn commented 1 year ago

Sure! In my package.json I changed: "react-native-swiper": "^1.6.0", to "react-native-swiper": "https://github.com/leecade/react-native-swiper#5827a80002738abd1c0dc08428303c79bbc840c0",

You're a super-man!

meycon1 commented 1 year ago

Sure! In my package.json I changed: "react-native-swiper": "^1.6.0", to "react-native-swiper": "https://github.com/leecade/react-native-swiper#5827a80002738abd1c0dc08428303c79bbc840c0",