Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Space.Compact 包裹单个 child 样式问题 #38590

Closed
luotongzhou opened this issue Nov 16, 2022 · 7 comments
Closed

[BUG] Space.Compact 包裹单个 child 样式问题 #38590

luotongzhou opened this issue Nov 16, 2022 · 7 comments
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@luotongzhou
Copy link

luotongzhou commented Nov 16, 2022

Reproduction link

Edit on CodeSandbox

Steps to reproduce

仓库是官方例子,删掉<Space.Compact>包裹的其他子组件留一下一个

What is expected?

Space.Compact 包裹单个子组件时子组件的 border 样式正常显示

What is actually happening?

Space.Compact 包裹单个子组件时子组件的 border 为 0

Environment Info
antd 4.24.2
React 17
System mac os 12.4
Browser Chrome 107.0.5304.87

Space.Compact 的样式似乎会影响所有后代组件,比如 <Popover content={}>, popover content 里如果有 button, input, border的样式也会收到影响,这取决于Popover包裹的子组件在Space.Compact里的位置

@afc163
Copy link
Member

afc163 commented Nov 17, 2022

@foryuki

@foryuki
Copy link
Contributor

foryuki commented Nov 23, 2022

Space.Compact 的样式似乎会影响所有后代组件,比如 , popover content 里如果有 button, input, border的样式也会收到影响,这取决于Popover包裹的子组件在Space.Compact里的位置

该问题已提 PR 。

期望:Space.Compact 包裹单个子组件时子组件的 border 样式正常显示

该场景在跟进中~

@vagusX vagusX added the 🐛 Bug Ant Design Team had proved that this is a bug. label Nov 23, 2022
@foryuki
Copy link
Contributor

foryuki commented Nov 23, 2022

@luotongzhou 只有一个子组件时不建议使用 Space.Compact 。
能说说你的使用场景嘛?确实也需要特殊处理下只有一个的情况,那我这边来处理下~

@luotongzhou
Copy link
Author

@foryuki 很常见的场景,表单里面,Space.Compact包裹的组件数目是动态的,根据另外一个表单项的值动态改变,恰好某个值可选项只有一个

@foryuki
Copy link
Contributor

foryuki commented Nov 23, 2022

@foryuki 很常见的场景,表单里面,Space.Compact包裹的组件数目是动态的,根据另外一个表单项的值动态改变,恰好某个值可选项只有一个

好嘞~马上支持

@luotongzhou
Copy link
Author

这个改动会同步到5.x吗

@foryuki
Copy link
Contributor

foryuki commented Nov 23, 2022

这个改动会同步到5.x吗

会先在 V5 改动,紧接着在 V4-stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants