From b99dffbd0952edce5b2097ea61c65e887411490f Mon Sep 17 00:00:00 2001 From: SimaQ Date: Tue, 18 Aug 2015 17:15:08 +0800 Subject: [PATCH] fix: fix Browser compatibility for .ant-form-inline. --- components/form/demo/inline-form.md | 2 +- components/form/index.md | 2 -- style/components/form.less | 32 +++++++++++++---------------- style/mixins/form.less | 2 -- 4 files changed, 15 insertions(+), 23 deletions(-) diff --git a/components/form/demo/inline-form.md b/components/form/demo/inline-form.md index a4d58e8c51..577d731951 100644 --- a/components/form/demo/inline-form.md +++ b/components/form/demo/inline-form.md @@ -2,7 +2,7 @@ - order: 1 -在**视口宽度大于等于 768px **时,你可以为 `
` 标签添加 `.ant-form-inline` 类可使其表现为 inline-block 级别的控件。 +你可以为 `` 标签添加 `.ant-form-inline` 类可使其表现为 inline-block 级别的控件。 --- diff --git a/components/form/index.md b/components/form/index.md index 17cb7c1112..ed81a9f759 100644 --- a/components/form/index.md +++ b/components/form/index.md @@ -16,8 +16,6 @@ - 水平排列:`.ant-form-horizontal` 类可以实现 `label` 标签和表单控件的水平排列; - 行内排列:`.ant-form-inline` 类可使其表现为 inline-block 级别的控件。 -**注**: `.ant-form-inline` 类只适用于**视口宽度大于等于 768px **的情形。 - ### 表单域 表单一定会包含表单域,表单域可以是输入控件,标准表单域,标签,下拉菜单,文本域等。 diff --git a/style/components/form.less b/style/components/form.less index 1de1117601..b00f8b8677 100644 --- a/style/components/form.less +++ b/style/components/form.less @@ -219,28 +219,24 @@ form { } //== Inline Form -// Attention: Inline form does only apply to within viewports that are at least 768px wide -// TODO: 优化 .@{css-prefix}form-inline { - @media (min-width: @screen-sm-min) { - .@{css-prefix}form-item { - display: inline-block; - margin-right: 10px; - } + .@{css-prefix}form-item { + display: inline-block; + margin-right: 10px; + } - .@{css-prefix}input { - display: inline-block; - width: auto; - vertical-align: middle; - } + .@{css-prefix}input { + display: inline-block; + width: auto; + vertical-align: middle; + } - .@{css-prefix}form-text { - display: inline-block; - } + .@{css-prefix}form-text { + display: inline-block; + } - .has-feedback { - display: inline-block; - } + .has-feedback { + display: inline-block; } } diff --git a/style/mixins/form.less b/style/mixins/form.less index edd5b36c97..b386a7ac81 100644 --- a/style/mixins/form.less +++ b/style/mixins/form.less @@ -51,9 +51,7 @@ } label { - display: inline-block; font-size: @font-size-base; - max-width: 100%; } input[type="search"] {