Skip to content

Conversation

LongHaoo
Copy link
Contributor

@LongHaoo LongHaoo commented Jan 5, 2022

问题原因

出现hover错误的原因是 子cell分配的index出现问题,分配的index应该是对于整个flattenData,而在前面的错误中分配index为每个子数组中相应数据的index

解决方案

仅仅修改将renderIndex取消传值,测试用例会发生错误。
所以增加一个renderIndex的prop传值,将render传入的index用renderIndex替代,其他的维持正确的index。

@afc163 afc163 requested a review from zombieJ January 5, 2022 03:25
@codecov
Copy link

codecov bot commented Jan 5, 2022

Codecov Report

Merging #729 (e3ce2b1) into master (d8583d8) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #729   +/-   ##
=======================================
  Coverage   99.37%   99.37%           
=======================================
  Files          33       33           
  Lines         964      964           
  Branches      278      278           
=======================================
  Hits          958      958           
  Misses          6        6           
Impacted Files Coverage Δ
src/Body/BodyRow.tsx 97.91% <ø> (ø)
src/Body/index.tsx 100.00% <ø> (ø)
src/Cell/index.tsx 98.95% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8583d8...e3ce2b1. Read the comment docs.

@LongHaoo
Copy link
Contributor Author

LongHaoo commented Jan 5, 2022

mentioned ant-design/ant-design#33453

@afc163
Copy link
Member

afc163 commented Jan 5, 2022

看上去解法没啥问题,尝试来个用例吧。

@afc163
Copy link
Member

afc163 commented Jan 5, 2022

可以补一些注释,这两个 index 和 renderIndex 看着糊涂。

@vercel
Copy link

vercel bot commented Jan 7, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/table/A8szbfNdokUvaGfuFTmzoSxJbo5R
✅ Preview: https://table-git-fork-longhaoo-fix-cell-hover-react-component.vercel.app

@afc163 afc163 merged commit 70fe0f4 into react-component:master Jan 7, 2022
@afc163
Copy link
Member

afc163 commented Jan 7, 2022

参考这个在 antd 里搞一下。#730 (comment)

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