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(virtualScoll): fix visibleData calculation to fix blank bug #2999

Merged
merged 6 commits into from
Aug 12, 2024

Conversation

huangchen1031
Copy link
Contributor

fix #2956

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

#2956

💡 需求背景和解决方案

滚动可视区域过高时,滚动后底部会留白。
原因是:渲染数据长度默认为bufferSize * 3,当rowHeight * bufferSize * 3 < 可视区域高度 * 2 时,小于的部分会变成空白。
解决方案:动态计算visibleData的长度,保持为填充满可视区域高度后,前后各增加bufferSize的长度。

📝 更新日志

  • fix(useVirtualScroll): 修改visibleData计算方式,解决可视区域过高时,滚动后底部留白的问题

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

Copy link
Contributor

github-actions bot commented Jul 19, 2024

完成

@uyarn
Copy link
Collaborator

uyarn commented Jul 25, 2024

/update-snapshot

1 similar comment
@uyarn
Copy link
Collaborator

uyarn commented Jul 31, 2024

/update-snapshot

@uyarn uyarn changed the title fix(usevirtualscoll): 修改visibleData计算方式,解决可视区域过高时,滚动后底部留白的问题 fix(virtualScoll): fix visibleData calculation to fix blank bug Aug 1, 2024
@uyarn
Copy link
Collaborator

uyarn commented Aug 1, 2024

这个改动会影响部分其他使用useVirtualScroll的组件的行为
image

@huangchen1031
Copy link
Contributor Author

这个改动会影响部分其他使用useVirtualScroll的组件的行为 image

修改了lastIndex的初始值为data.length ,解决在滚动到底部的时候有些场景找不到匹配不到一个元素。

Copy link
Collaborator

@uyarn uyarn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@uyarn uyarn merged commit 5ce127e into Tencent:develop Aug 12, 2024
6 checks passed
@github-actions github-actions bot mentioned this pull request Aug 22, 2024
16 tasks
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.

[Tree] 虚拟滚动高度问题
2 participants