react-native-parallax-scroll-view icon indicating copy to clipboard operation
react-native-parallax-scroll-view copied to clipboard

onEndReached not getting called for ListView

Open muskeinsingh opened this issue 9 years ago • 16 comments
trafficstars

Hey,

I'm using a ParallaxScrollView inside the renderScrollComponent of the ListView on ReactNative-Android . I've implemented onEndReached on the ListView to make sure more items are fetched as soon as the item list is about to end. But as soon as I add ParallaxScrollView in the renderScrollComponent, it renders only the first fold of items and never queries for more items. Can somebody help on this? I'm currently using React Native 0.30.0. @jaysoo

muskeinsingh avatar Aug 17 '16 14:08 muskeinsingh

Same problem here. is it really the problem?

waleedarshad-vf avatar Aug 26 '16 12:08 waleedarshad-vf

Anybody working on it??? @jaysoo ?. 25 days have been passed. i am stuck with development. any other library which will help? @muskeinsingh what did you use?

waleedarshad-vf avatar Sep 20 '16 07:09 waleedarshad-vf

@waleedarshad-vf I kind of developed a way of my own. I started listening to the scrollListener on the Listview and Animated my View using a transform. I didn't use the ParallaxScrollView in my renderScrollComponent since it was only causing more problems than it was helping. @jaysoo any help on this would be appreciated since what I did doesn't seem to be a clean solution. It's more of a hack around this.

muskeinsingh avatar Sep 20 '16 08:09 muskeinsingh

@muskeinsingh for the time being can you share sample code from you solution which works or any other solution you suggest?

waleedarshad-vf avatar Sep 20 '16 10:09 waleedarshad-vf

@muskeinsingh ? need your help

waleedarshad-vf avatar Sep 22 '16 07:09 waleedarshad-vf

@alaycock how can i used onReachEnd? can you help me?

waleedarshad-vf avatar Sep 22 '16 07:09 waleedarshad-vf

@jaysoo would you please advise?

waleedarshad-vf avatar Sep 22 '16 07:09 waleedarshad-vf

Use this prop for ListView : onScroll:this.handleScroll. HandleScroll looks like this. handleScroll(event:Object){ this.scrollPostion = event.nativeEvent.contentOffset.y; } It should return you the scrollPosition and then you can animate the view based on this. Hope this helps!

muskeinsingh avatar Sep 22 '16 07:09 muskeinsingh

Thanks @muskeinsingh this resolved the problem. I was suffering from this issue from last 27 days finally resolved it with your help. Thanks again. :)

waleedarshad-vf avatar Sep 22 '16 13:09 waleedarshad-vf

Sure thing. @waleedarshad-vf @jaysoo can we get some generic solution here?

muskeinsingh avatar Sep 23 '16 09:09 muskeinsingh

@muskeinsingh #60 fixed the issue for us

philipheinser avatar Dec 08 '16 04:12 philipheinser

Taking a look.

jaysoo avatar Dec 14 '16 14:12 jaysoo

Fixed with:

On handleScroll:

  _onScrollHandled(e) {
    const scrollOffset = e.nativeEvent.layoutMeasurement.height + e.nativeEvent.contentOffset.y
    const scrollHeight = e.nativeEvent.contentSize.height

    if(scrollOffset == scrollHeight) {
      this.scrollIsFetching = true
      this._onEndReached()
  } 

And in ParallaxScrollView

			<ParallaxScrollView
				onScroll={ (e) => this._onScrollHandled(e) }

PD: Last version published on npm is 0.19.0, not 0.20.1

Now increase the size of list, but scroll component or listview dont render the new items. The list size change, but nothing happens. If i remove ParallaxScrollView from renderScrollComponent listView prop all works fine. Some help @jaysoo

luisfuertes avatar Sep 06 '17 13:09 luisfuertes

@muskeinsingh any update about this? I can fix onEndReached, but i cant fix the bug with re-render with more list results

luisfuertes avatar Sep 13 '17 10:09 luisfuertes

Ok, i think is height problem. I load 30 items on first render and list only render the 10 first items... @muskeinsingh can you help me to fix it?

luisfuertes avatar Nov 20 '17 10:11 luisfuertes

Ok, i think is height problem. I load 30 items on first render and list only render the 10 first items... @muskeinsingh can you help me to fix it?

same problem, list only render 10 items

https://stackoverflow.com/questions/40706450/why-is-this-listview-only-showing-10-items

fixed for me =,=

nppull avatar Sep 17 '18 06:09 nppull