Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renderIndexPath的section, row会发生一次意外的刷新 #469

Open
dxiya8948 opened this issue Dec 15, 2021 · 2 comments
Open

renderIndexPath的section, row会发生一次意外的刷新 #469

dxiya8948 opened this issue Dec 15, 2021 · 2 comments

Comments

@dxiya8948
Copy link

当使用this.LargeList.scrollTo({ x: 0, y: ofset, })跳转到列表某处时,renderIndexPath接收的({ section, row })会先跳到目标位置,此时数据是正常的,但很快会再次刷新导致旧数据出现(如下面的视频)

Dev OS (Mac)
Target OS (Android)
Simulator or real device? (Real Device)

react-native: 0.64.2, 
react-native-spring-scrollview: ^3.0.1-rc.5,
react-native-largelist: ^3.1.0-rc.2
renderIndexPath = ({ section, row }) => {
    const { countriesLargeListData } = this.state;
    const item = countriesLargeListData[section].items[row];

    return this.renderItem(item);
  }

render() {
  return (
  ...
    <FlexColContainer
        width="0"
        height="match_parent"
        flexGrow="1"
      >
        <LargeList
          ref={(ref) => { this.LargeList = ref; }}
          updateTimeInterval={10000}
          renderSection={this.renderSection}
          renderIndexPath={this.renderIndexPath}
          refreshHeader={ActivityIndicator}
          renderFooter={this.renderFooter}
          data={countriesLargeListData || []}
          heightForSection={() => SectionHeight}
          heightForIndexPath={() => IndexHeight}
          renderHeader={showHeader ? this.renderHeader : () => null}
        />
      </FlexColContainer>
  ...
    );
}
1639549970838558.mp4
@dxiya8948
Copy link
Author

使用this.LargeList.scrollTo({ x: 0, y: ofset, }, false)或者this.LargeList.scrollToIndexPath({ section: key }, false)取消动画效果就没有这个问题~

这暂时解决了我的问题,但是最好还是希望有动画!

@ghost
Copy link

ghost commented Jan 13, 2023

@dxiya8948
how can set you customs height in larglist
renderIndexPath={this.renderIndexPath}

my problem

when I hide data ,data space also hide but it's not working in my code how can I soul this

I want like this

more details here

if you have any idea let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant