Flipkart / recyclerlistview

High performance listview for React Native and web!
Apache License 2.0
5.21k stars 426 forks source link

recyclerlistview freeze on iOS when it is removed and added back from superview #562

Open dingxinal opened 3 years ago

dingxinal commented 3 years ago

Hi,

Thanks for this awesome project! But when i implemented it in iOS, I found an issue: when I am scrolling on this recyclerListView, the other part of the app get refreshed, then the app remove this React Native view and added back immediately(will not re-render this component). But then I am unable to clicked on each item(each data is a button). But it is scrollable, I can only click it again once I scroll far away and scroll back.

Could you help to see is there anything that I miss here?

<View
        style={{  flex: 1 }}
 >
<RecyclerListView
          ref={rlv => this.rlv = rlv}
          layoutProvider={this.state.layoutProvider}
          dataProvider={this.state.dataProvider}
          rowRenderer={this.rowRenderer}
          contextProvider={this.ContextProvider}
          extendedState={this.props.renderDayParams}
          initialRenderIndex={this.props.initialRenderIndex}
          onVisibleIndicesChanged={this.onVisibleIndicesChanged}
          isHorizontal
 />
 </View>
Only-IceSoul commented 3 years ago

try this


                dataProvider={new DataProvider((r1:MyType,r2:MyType) => {
                    return r1.uid != r2.uid
                 }).cloneWithRows(this.state.items)}

                 layoutProvider={new LayoutProvider( _ => 0,(type:string | number,dim:Dimension,index:number) => {
                    dim.width = 200
                    dim.height = 200
                })}
dingxinal commented 3 years ago

try this


                dataProvider={new DataProvider((r1:MyType,r2:MyType) => {
                    return r1.uid != r2.uid
                 }).cloneWithRows(this.state.items)}

                 layoutProvider={new LayoutProvider( _ => 0,(type:string | number,dim:Dimension,index:number) => {
                    dim.width = 200
                    dim.height = 200
                })}

Yeah, it is already implemented like the way you wrote. I feel it might more a ScrollerView issue. As the issue persists even if replace with a simple ScrollerView component.