Skip to content

Form uses layout to set labelCol and wrapperCol at the same time for inline to show no effect #3862

@IanLew

Description

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

Version

2.1.0

Environment

window10, Google Chrome 89.0.4389.82, vue 3.0.7

Reproduction link

Edit on CodeSandbox

Steps to reproduce

<a-form
layout="inline"
:model="form"
:label-col="{ span: 8 }"
:wrapper-col="{ span: 16 }"

What is expected?

按照labelCol和wrapperCol设置重新分配占比

What is actually happening?

并没有跟随Form.Item的宽度变化产生变化


从style上看:.ant-form-item的display:inline-block覆盖了.ant-row的display:flex,而内部的.ant-col-*是使用的flex进行伸缩flex: 0 0 *%,从而导致inline达不到效果

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions