Giter Club home page Giter Club logo

Comments (5)

subpublic avatar subpublic commented on July 2, 2024

Seems like if I don't bind onMomentumScrollEnd, the index updates.
So when binding onTouchStartCapture everything works better.

Still not sure if that was a bug, but this works for me.

from react-native-swiper.

leecade avatar leecade commented on July 2, 2024

Thanks @subpublicanders

First update index, then call onMomentumScrollEnd, is this helpfully? or I am very pleased to follow up your problem.

/**
   * Scroll end handle
   * @param  {object} e native event
   */
  onScrollEnd(e) {

    // update scroll state
    this.setState({
      isScrolling: false
    })

    let offset = e.nativeEvent.contentOffset
    this.updateIndex(offset, this.state.dir)

    // if `onMomentumScrollEnd` registered will be called here
    this.props.onMomentumScrollEnd && this.props.onMomentumScrollEnd.call(this)
  },

from react-native-swiper.

subpublic avatar subpublic commented on July 2, 2024

Well, I solved it by not using onMoementumScrollEnd at all.
If i bind onMoementumScrollEnd in my Swiper-jsx, then the onScrollEnd is never even called.
I set a console.log in your code to try it. Could it have something to do with the default render (line 389)? That it gets overridden.

from react-native-swiper.

leecade avatar leecade commented on July 2, 2024

oh yes, onMoementumScrollEnd be overridden, thanks, i will fix it later.

from react-native-swiper.

ursnj avatar ursnj commented on July 2, 2024

@leecade when im loading content from some rest service, onMomentumScrollEnd and onIndexxhanged related is not working till the response returns back to the application from API. can you have any idea on this ???

from react-native-swiper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.