ant-design Only one fixed column work when multiple columns specified as fixed if using virtual list

t40tm48m  于 5个月前  发布在  其他
关注(0)|答案(4)|浏览(41)

Steps to reproduce

When using virtual list, specify 2 columns as fixed.

What is expected?

Both 2 columns header are fixed.

What is actually happening?

Only one column header is fixed, the other is ignored.
| Environment | Info |
| ------------ | ------------ |
| antd | 4.20.4 |
| React | 18 |
| System | macOS 11.4 |
| Browser | Chrome 101.0.4951.64 |

When not using virtual list, it works as expected.

zfycwa2u

zfycwa2u1#

i've done some research on this:
https://github.com/react-component/table/blob/1d155cf57ffd7eaaa144d1e0d543f05e5ab05e98/src/Body/index.tsx#L119

i think it might be related to this onColumnResize function, when user is not using default body component then the column sizes are not update even though they are specified in column prop.

So maybe something need to be changed here:
https://github.com/react-component/table/blob/4cba6e67cd5d08badbe54be6d4a8c423c258a83e/src/Table.tsx#L632

Either making the customized body renderer able to access this onColumnResize function, or we reassign the value of stickyOffsets in headerProps similar to line 632.

Should i just move this issue to lib rc-table ?

nr9pn0ug

nr9pn0ug2#

Hello @knightf. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please send your Pull Request to proper branch (feature branch for the new feature, master for bugfix and other changes), fill the Pull Request Template here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!

你好 @knightf,我们完全同意你的提议/反馈,欢迎直接在此仓库 创建一个 Pull Request 来解决这个问题。请将 Pull Request 发到正确的分支(新特性发到 feature 分支,其他发到 master 分支),务必填写 Pull Request 内的 预设模板 ,提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。

k10s72fa

k10s72fa4#

@afc163 sorry to bother you, i have submitted a fix and waiting for the release. Would you mind looking into it?

相关问题