当前位置:网站首页>【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>
写完后的样式如下图,间隔正常了~
边栏推荐
- SQL语言
- .Net之延迟队列
- Lick the dog until the last one has nothing (state machine)
- Openharmony application development how to create dayu200 previewer
- The only core indicator of high-quality software architecture
- Xue Jing, director of insight technology solutions: Federal learning helps secure the flow of data elements
- C语言程序设计选题参考
- ViewBinding和DataBinding的理解和区别
- Flet教程之 03 FilledButton基础入门(教程含源码)(教程含源码)
- Scripy framework learning
猜你喜欢

Automatic filling of database public fields

Node の MongoDB安装

Flet tutorial 03 basic introduction to filledbutton (tutorial includes source code) (tutorial includes source code)

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

Understanding and difference between viewbinding and databinding

Source code compilation and installation of MySQL

When MDK uses precompiler in header file, ifdef is invalid

基于链表管理的单片机轮询程序框架

30:第三章:开发通行证服务:13:开发【更改/完善用户信息,接口】;(使用***BO类承接参数,并使用了参数校验)

Samsung's mass production of 3nm products has attracted the attention of Taiwan media: whether it can improve the input-output rate in the short term is the key to compete with TSMC
随机推荐
Getting started with the go language is simple: go implements the Caesar password
C语言图书租赁管理系统
Three schemes to improve the efficiency of MySQL deep paging query
提高MySQL深分页查询效率的三种方案
C language dormitory management query software
XML入门三
Detailed explanation of Fisher information quantity detection countermeasure sample code
Animation and transition effects
字节面试算法题
Personalized online cloud database hybrid optimization system | SIGMOD 2022 selected papers interpretation
JVM series - stack and heap, method area day1-2
Alibaba cloud award winning experience: build a highly available system with polardb-x
如何在 2022 年为 Web 应用程序选择技术堆栈
Rsyslog configuration and use tutorial
Oracle 被 Ventana Research 评为数字创新奖总冠军
Cors: standard scheme of cross domain resource request
CommVault cooperates with Oracle to provide metallic data management as a service on Oracle cloud
Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example
MySQL 45 lecture - learn the actual combat notes of MySQL in Geek time 45 lecture - 06 | global lock and table lock_ Why are there so many obstacles in adding a field to the table
Distributed base theory