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(table): table footer may not be displayed when switching tabs #3370

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

wonkzhang
Copy link
Contributor

@wonkzhang wonkzhang commented Feb 19, 2025

🤔 这个 PR 的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

  • 这个问题已经定位到原因了,table在初始化后,会调用useEffect,动态计算表格滚动高度等变量,来动态设置isFixedHeader变量(暂且叫它悬浮变量),
  • 如果悬浮变量为true的时候,会在表格页脚(footer)上增加fixed定位的样式,这样咱们就能看到底部的总数表页脚了。
  • 现在的问题是,第二个TabPanel下的table在useEffect执行的时候,滚动高度为0(因为内容尚未初始化),导致悬浮变量是false,所以就看不到页脚。
  • 此刻点击排序就能看到页脚汇总行,是因为排序会引起useEffect重新执行,此刻滚动高度是正常的数值(大于0),所以悬浮变量的值为true。

📝 更新日志

  • fix(Table): 修复配合Tabs使用,切换tab时,Table的footer可能不显示的问题

  • 本条 PR 不需要纳入 Changelog

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

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

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

修复tabs切换的时候表格table的footer可能不显示的问题

fix #3365
Copy link
Contributor

github-actions bot commented Feb 19, 2025

完成

删除掉一段不太需要的注释

fix #3370
@uyarn uyarn changed the title fix(table): 修复tabs切换的时候表格table的footer可能不显示的问题 fix(table): table footer may not be displayed when switching tabs Feb 19, 2025
@uyarn uyarn merged commit e917392 into Tencent:develop Feb 20, 2025
7 checks passed
@uyarn uyarn mentioned this pull request Feb 20, 2025
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.

3 participants