当前位置:网站首页>【Antd踩坑】Antd Form 配合Input.Group时出现Form.Item所占据的高度不对
【Antd踩坑】Antd Form 配合Input.Group时出现Form.Item所占据的高度不对
2022-07-04 12:48:00 【似酒龙井】
Antd Form 配合Input.Group时出现Form.Item所占据的高度不对,间隔会偏大,如下图红框
看了下代码,可能是因为Input.Group导致有额外的margin-bottom
</Form.Item>
<Form.Item label="Y主轴取值范围">
<Input.Group compact>
<Form.Item name="YMainAxisRangeMin">
<Input
addonBefore=""
style={
{
width: 100, textAlign: 'center' }}
placeholder="Minimum"
/>
</Form.Item>
<Input
className="site-input-split"
style={
{
width: 30,
borderLeft: 0,
borderRight: 0,
pointerEvents: 'none',
}}
placeholder="~"
disabled
/>
<Form.Item name="YMainAxisRangeMax">
<Input
className="site-input-right"
style={
{
width: 100,
textAlign: 'center',
}}
placeholder="Maximum"
/>
</Form.Item>
</Input.Group>
</Form.Item>
<Form.Item label="Y主轴步长" name="YMainAxisStep">
<Input
style={
{
width: 100, textAlign: 'center' }}
placeholder="Y主轴步长"
/>
</Form.Item>
想了个解决方法:在Form.Item外再嵌套一个div并限制其高度,即可解决「我知道治标不治本,求求不喜勿喷」
</Form.Item>
<div style={
{
height: '56px' }}>
<Form.Item label="Y主轴取值范围">
<Input.Group compact>
<Form.Item name="YMainAxisRangeMin">
<Input
addonBefore=""
style={
{
width: 100, textAlign: 'center' }}
placeholder="Minimum"
/>
</Form.Item>
<Input
className="site-input-split"
style={
{
width: 30,
borderLeft: 0,
borderRight: 0,
pointerEvents: 'none',
}}
placeholder="~"
disabled
/>
<Form.Item name="YMainAxisRangeMax">
<Input
className="site-input-right"
style={
{
width: 100,
textAlign: 'center',
}}
placeholder="Maximum"
/>
</Form.Item>
</Input.Group>
</Form.Item>
</div>
<Form.Item label="Y主轴步长" name="YMainAxisStep">
<Input
style={
{
width: 100, textAlign: 'center' }}
placeholder="Y主轴步长"
/>
</Form.Item>
写完后的样式如下图,间隔正常了~
边栏推荐
- Using nsproxy to forward messages
- Node の MongoDB安装
- C语言程序设计选题参考
- Xilinx/system-controller-c/boardui/ unable to connect to the development board, the solution of jamming after arbitrary operation
- C foundation in-depth learning II
- How to choose a technology stack for web applications in 2022
- . Net delay queue
- C#基础深入学习一
- Redis - how to install redis and configuration (how to quickly install redis on ubuntu18.04 and centos7.6 Linux systems)
- Configure WebDAV server on Apache
猜你喜欢

Comparative study of the gods in the twilight Era

unity不识别rider的其中一种解决方法

基于STM32+华为云IOT设计的酒驾监控系统
Three schemes to improve the efficiency of MySQL deep paging query

光环效应——谁说头上有光的就算英雄

Redis - how to install redis and configuration (how to quickly install redis on ubuntu18.04 and centos7.6 Linux systems)

Fisher信息量检测对抗样本代码详解

JVM系列——栈与堆、方法区day1-2

Dgraph: large scale dynamic graph dataset

2022KDD预讲 | 11位一作学者带你提前解锁优秀论文
随机推荐
XML入门三
美国土安全部长:国内暴力极端主义是目前美面临的最大恐怖主义威胁之一
c#数组补充
Web knowledge supplement
XML入门二
8 expansion sub packages! Recbole launches 2.0!
Distributed base theory
Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example
Install Trinity and solve error reporting
C语言程序设计
After the game starts, you will be prompted to install HMS core. Click Cancel, and you will not be prompted to install HMS core again (initialization failure returns 907135003)
Iptables foundation and Samba configuration examples
.NET 使用 redis
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
Redis - how to install redis and configuration (how to quickly install redis on ubuntu18.04 and centos7.6 Linux systems)
XILINX/system-controller-c/BoardUI/无法连接开发板,任意操作后卡死的解决办法
FS7867S是一款应用于数字系统供电电源电压监控的电压检测芯片
PostgreSQL 9.1 soaring Road
逆向调试入门-PE结构-资源表07/07
Fs4056 800mA charging IC domestic fast charging power IC