fix(cdk:scroll): virtual list render error after dataSource change #1949
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
What is the current behavior?
虚拟滚动,当数据更新时,有几率导致某行的列数据渲染没有正常更新到新的数据
出现于:proTable 开启双向虚拟滚动,并取消勾选某几列的显示(无横向滚动条状态),向下滚动,会出现某行的列并没有改变,而导致整个表格的列错位
What is the new behavior?
修复以上问题
Other information
问题原因:
在渲染池计算的过程中,如果有某行的渲染池元素被回收且没有被立刻复用,其中的列就并不会在数据更新的时候全回收,导致该元素被复用的时候列数据出现错误
修改方法:
在一次行更新的过程中,找到没有被当次更新直接复用并退回到渲染池中的元素,回收该元素中所有的列数据