Table 设置 scroll={{ x: 'max-content' }} 后内部的 Description 组件会变得宽度非常大。

#54268

Issue Details

18 days ago
besidewindbesidewind
unconfirmed
besidewindbesidewind
opened 18 days ago
Author

Edit on CodeSandbox

Steps to reproduce

重现链接有两个 Table,第二个设置了 scroll={{ x: 'max-content' }},前三列分别用 style={{ width: '100%' }},style={{ width: 'max-content' }},Description 组件渲染。

Image

What is expected?

Description 宽度正常。例如 Description 所有列宽度都等于内容宽度最大的 Description 列的宽度。或者像第一二列一样的表现。

What is actually happening?

查看 Description 宽度有 50 万像素。

EnvironmentInfo
antd5.26.2
ReactReact 18.0.0
SystemMacOS
Browserchrome 137.0.7151.104

应该展示成什么样我不是很肯定,我在 Descriptions 上设置了 bordered 之后宽度没有变的非常大,但是宽度根据内容不同是参差不齐的。这里我将 Descriptions 放在展开行里了,如果不加 bordered,展开行会将整个列表撑到 50 万像素宽。

Image