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

fix(cdk:virtual): render pool item with same item key is not reused #1910

Merged
merged 1 commit into from
May 7, 2024

Conversation

sallerli1
Copy link
Contributor

when all data is re-rendered, pooled items were asigned to data with different item key

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added/updated or not needed
  • Docs and demo have been added/updated or not needed

What is the current behavior?

在全部数据被重新渲染之后,所有的渲染池元素被回收并重新分配,当新添加的数据在上次渲染的数据前面时,会将已经回收的元素先分配给新数据,导致老数据在渲染时视图的key与上次渲染不一致。

What is the new behavior?

修复以上问题

Other information

会进行两次遍历,第一次筛选出上一次渲染的数据并分配原本的渲染池元素,第二次遍历剩余的新数据元素从渲染池中按顺序分配元素

when all data is re-rendered, pooled items were asigned to data with different item key
Copy link

idux-bot bot commented May 6, 2024

This preview will be available after the AzureCI is passed.

Copy link

codecov bot commented May 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.75%. Comparing base (3ef5760) to head (dca5d3b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1910   +/-   ##
=======================================
  Coverage   90.75%   90.75%           
=======================================
  Files         359      359           
  Lines       35286    35286           
  Branches     2807     2807           
=======================================
  Hits        32024    32024           
  Misses       3262     3262           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sallerli1 sallerli1 merged commit df3a961 into IDuxFE:main May 7, 2024
8 of 9 checks passed
@sallerli1 sallerli1 deleted the fix-virtual-scroll-rerender branch July 4, 2024 09:21
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

Successfully merging this pull request may close these issues.

None yet

1 participant