Skip to content

Conversation

knightf
Copy link

@knightf knightf commented May 16, 2022

🤔 This is a ...

  • Bug fix

🔗 Related issue link

ant-design/ant-design#35562

💡 Background and solution

  1. extracted the logic of calculating sticky columns' width to a pure function for sharing
  2. imported this function in Table component to update the stickyOffsets value

📝 Changelog

Language Changelog
🇺🇸 English Fixed the table header issue when multiple columns are fixed in virtual rendering.
🇨🇳 Chinese 修复了虚拟渲染时多列固定的情况下表头错位的问题。

@vercel
Copy link

vercel bot commented May 16, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
table ✅ Ready (Inspect) Visit Preview May 16, 2022 at 8:04AM (UTC)

@codecov
Copy link

codecov bot commented Jun 6, 2022

Codecov Report

Merging #812 (26a8454) into master (7cb9401) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #812   +/-   ##
=======================================
  Coverage   99.37%   99.38%           
=======================================
  Files          35       35           
  Lines         967      971    +4     
  Branches      293      293           
=======================================
+ Hits          961      965    +4     
  Misses          6        6           
Impacted Files Coverage Δ
src/Table.tsx 99.18% <100.00%> (+<0.01%) ⬆️
src/hooks/useStickyOffsets.ts 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more


return 0;
}) as number[];
headerProps.stickyOffsets = stickyOffsetCalculator(
Copy link
Member

Choose a reason for hiding this comment

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

这样每次 render 都会调用一次 stickyOffsetCalculator,性能会差很多。

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.

2 participants