recyclerlistview
recyclerlistview copied to clipboard
Pull to refresh lagging.
I have RLV with RefreshControl and when i refresh, refresh indicator starts to appear and disappear. my RLV jumping. This issue present only with small amount of elements.
`
<View style={{minHeight: Dimensions.get('window').height, width: Dimensions.get('window').width}}>
{ this.state.dataProvider && this.state.data.length > 0 &&
<RecyclerListView
ref={(ref) => this.recyclerView = ref}
canChangeSize
scrollViewProps={{
contentContainerStyle: {paddingBottom: (isIphoneX() ? 140 : 90)},
stickyHeaderIndices: [1],
refreshControl:
<RefreshControl
refreshing={this.state.refreshing}
onRefresh={async () => {
this.setState({
refreshing: true
});
await this.loadEmployees();
this.setState({
refreshing: false
});
}}
/>
}}
layoutProvider={this._layoutProvider}
dataProvider={this.state.dataProvider}
rowRenderer={this._rowRenderer}
/>
}
</View>
`
Can you provide an expo sample to check?
@naqvitalha
When using RLV with small amount items. Then try to pull to refresh on iOS. this bug may appear. Just try many times.
@naqvitalha
When i go deep inside RLV source code. Finally i find out _pendingScrollToOffset
. It may keep RLV content offset larger than 0 after RLV did update.
I made changed like image below. Please tell me what features will lose or go wrong.
@LVBK nice job! After reviewing the source code, i found that _pendingScrollToOffset is used for fix scroll offset after render() called. The _pendingScrollToOffset.y maybe below 0, so in the componentDidUpdate function i add a condition like this:
Hope this defect would be fixed in the next released version.
@xmuSistone yeah, you're right.
@xmuSistone Thanks for the solution.
@LVBK Could you provide a demo to reproduce the issue?
is issue still open or solved?
Hi i am facing same is anyone have solution for same? even when i drag the list for pull_to_refresh it is automatically release not like flatlist.
Hi i am facing same is anyone have solution for same? even when i drag the list for pull_to_refresh it is automatically release not like flatlist.
I try to add this param and pull to refresh start working... <RecyclerListView scrollViewProps={{ refreshControl: ( <RefreshControl refreshing={loader} onRefresh={() => { // start loader // do the stuff u want //stop the loader }} /> ), }} />
thanks @aim8526 but my problem is pull_to_refresh it is automatically release without drop it.
Lagging when items in the list fit less the container height