Skip to content

Conversation

Barrywww
Copy link
Contributor

修复了issue#755第一点提及的问题。

antd的官方文档中并未提及expandable.fixed 和 scroll 两属性需要同时设置,因此将scroll属性置空不应导致整个table crash。采用了默认的auto方式设置水平方向的scroll。

@vercel
Copy link

vercel bot commented Mar 15, 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/7vM91XXz9K5ovM3HKmqx2v58Rb8b
✅ Preview: https://table-git-fork-barrywww-fix-expandable-crash-react-component.vercel.app

@horseson2018
Copy link

👏👏👏

@afc163
Copy link
Member

afc163 commented Mar 16, 2022

来个测试用例

@codecov
Copy link

codecov bot commented Mar 16, 2022

Codecov Report

Merging #764 (a2c38c7) into master (1d155cf) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #764   +/-   ##
=======================================
  Coverage   99.38%   99.38%           
=======================================
  Files          35       35           
  Lines         978      979    +1     
  Branches      279      279           
=======================================
+ Hits          972      973    +1     
  Misses          6        6           
Impacted Files Coverage Δ
src/Table.tsx 99.17% <100.00%> (+<0.01%) ⬆️

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

src/Table.tsx Outdated
}
scrollTableStyle = {
width: scroll.x === true ? 'auto' : scroll.x,
width: horizonScroll ? (scroll.x === true ? 'auto' : scroll.x) : 'auto',

Choose a reason for hiding this comment

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

应该直接在这一行加一个

scroll && scroll.x 

就可以了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!这样会减少逻辑改动。直接这么改TS会报类型错误,我稍修改了一下然后新开了一个PR

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.

4 participants