From ad911d8dfa5e12091d0ff254a0f510efd82db048 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 4 Dec 2016 16:42:49 +0800 Subject: [PATCH] Change way to fix #4092 --- components/input/Input.tsx | 6 ++++++ components/input/style/index.less | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/input/Input.tsx b/components/input/Input.tsx index 05a04b25d1..06f590bbcf 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -140,6 +140,12 @@ export default class Input extends Component { renderLabledInput(children) { const props = this.props; + + // Not wrap when there is not addons + if (props.type === 'textarea' || (!props.addonBefore && !props.addonAfter)) { + return children; + } + const wrapperClassName = `${props.prefixCls}-group`; const addonClassName = `${wrapperClassName}-addon`; const addonBefore = props.addonBefore ? ( diff --git a/components/input/style/index.less b/components/input/style/index.less index 9545cb3369..31e9bafadc 100644 --- a/components/input/style/index.less +++ b/components/input/style/index.less @@ -8,10 +8,6 @@ .input; } -.@{ant-prefix}-input-wrapper { - display: inline-block; -} - //== Style for input-group: input with label, with button or dropdown... .@{ant-prefix}-input-group { .input-group(~"@{ant-prefix}-input");