Skip to content

a-radio-group在a-form-item中产生额外换行问题 #3319

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

Closed
1 task
7emotion opened this issue Dec 7, 2020 · 8 comments · Fixed by #3538
Closed
1 task

a-radio-group在a-form-item中产生额外换行问题 #3319

7emotion opened this issue Dec 7, 2020 · 8 comments · Fixed by #3538
Assignees

Comments

@7emotion
Copy link

7emotion commented Dec 7, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.0.0-rc.2

Environment

vue3.0.3

Reproduction link

https://2x.antdv.com/components/radio-cn/#components-radio-demo-radio-style

Steps to reproduce

<template>
<a-form layout="vertical">
<a-form-item>
<a-input
placeholder="这是一个输入框,底部的间隔为正常状态,a-radio-group在特殊情况会有占用两行的情况"
/>
</a-form-item>

<a-form-item>
<a-radio-group class="w-100">
<a-radio-button :value="1" class="w-50 text-center">
one select
</a-radio-button>
<a-radio-button :value="2" class="w-50 text-center">
底部的间隔占用了两行
</a-radio-button>
</a-radio-group>
</a-form-item>

<a-form-item>
<a-radio-group class="w-100">
<a-radio-button :value="1" class="w-50 text-center">
AAAAAAAAAAAAAAAA
</a-radio-button>
<a-radio-button :value="2" class="w-50 text-center">
BBBBBBBBBBBBBBBB
</a-radio-button>
</a-radio-group>
</a-form-item>

<a-form-item>
<a-radio-group class="w-100">
<a-radio-button :value="1" class="w-50 text-center">
one select
</a-radio-button>
<a-radio-button :value="2" class="w-50 text-center">
底部的间隔占用了两行
</a-radio-button>
</a-radio-group>
</a-form-item>

<a-form-item>
<a-radio-group class="w-100">
<a-radio-button :value="1" class="w-50 text-center">
one select
</a-radio-button>
<a-radio-button :value="2" class="w-50 text-center">
底部的间隔占用了两行
</a-radio-button>
</a-radio-group>
</a-form-item>

<a-form-item>
<a-button type="primary" block>submit</a-button>
</a-form-item>
</a-form>
</template>
<style scoped>
.w-100 {
width: 100%;
}
.w-50 {
width: 50%;
}
.text-center {
text-align: center;
}
</style>

What is expected?

解决a-radio-group在a-form-item中占用多行,导致间隔过高的问题

What is actually happening?

解决a-radio-group在a-form-item中占用多行,导致间隔过高的问题


解决a-radio-group在a-form-item中占用多行,导致间隔过高的问题

@John60676
Copy link
Member

https://codesandbox.io/s/admiring-cloud-pr2rn?file=/src/App.vue
未能复现你的问题,请提供一个复现例子

@John60676 John60676 added the 🤔 Need Reproduce We cannot reproduce your problem label Dec 8, 2020
@github-actions
Copy link

github-actions bot commented Dec 8, 2020

Hello @Small-Shu. Please provide a online reproduction by forking this link for vue2link for vue3 or a minimal GitHub repository.Make sure to choose the correct version.

你好 @Small-Shu, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 for vue2此处 for vue3 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。请确保选择准确的版本。

@7emotion
Copy link
Author

7emotion commented Dec 8, 2020

https://codesandbox.io/s/admiring-cloud-pr2rn?file=/src/App.vue
未能复现你的问题,请提供一个复现例子

https://codesandbox.io/s/condescending-ganguly-z3re5
请尝试将CSS添加进去,我已经在上面连接进行了修改。

@John60676 John60676 added 2.x for 2.x and removed 🤔 Need Reproduce We cannot reproduce your problem labels Dec 8, 2020
@tangjinzhou
Copy link
Member

image
这不是一样的间隔吗

@7emotion
Copy link
Author

image
这不是一样的间隔吗

image
我不知道你是如何实现的,你可以查看:https://codesandbox.io/s/condescending-ganguly-z3re5 里面的代码来复现我的问题。

@John60676
Copy link
Member

临时方案:
.ant-form-item-control-wrapper 给这个类一个 width: 100% 的样式

@7emotion
Copy link
Author

这个多久可以更新进去。。

John60676 added a commit to John60676/ant-design-vue that referenced this issue Jan 14, 2021
tangjinzhou pushed a commit that referenced this issue Jan 14, 2021
* fix: form-item wrong line break

fix #3319

* style: add commit
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants