ant-design Descriptions labelStyle incorrectly applied on vertical layouts

798qvoo8  于 4个月前  发布在  其他
关注(0)|答案(2)|浏览(60)

Steps to reproduce

Set up a Descriptions sample.
Add the labelStyle prop
Change the layout to vertical, and you will see the labelStyle prop does not put the styles on the correct node, it puts the styles on the span instead of the "ant-descriptions-item-label" class div.

What is expected?

I expect the labelStyle to be applied to the div with the className "ant-descriptions-item-label".

What is actually happening?

When in horizontal mode, the labelStyle goes to the className "ant-descriptions-item-label", but when in vertical mode, the labelStyle goes to the child span.
| Environment | Info |
| ------------ | ------------ |
| antd | 5.20.0 |
| React | 18.0.0 |
| System | Windows |
| Browser | Firefox v129.0 |

I believe the codesandbox I provided should give a clear view of the problem happening.

xdnvmnnf

xdnvmnnf1#

Hmmm... when with bordered , the patch label className is not apply on the correct element. But I guess this is hard to fix since it exist for years.

5gfr0r5j

5gfr0r5j2#

Hard to change the dom apply to.
It's better to provider styles to implement a new one.

相关问题