From 010860ae0fc68dfeddc49d4765f27f1e86448968 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 15 May 2017 18:15:29 +0800 Subject: [PATCH] Fix style.height issue of Input with addon and prefix, close #6144 --- components/input/Input.tsx | 7 ++++++- components/input/style/index.less | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/components/input/Input.tsx b/components/input/Input.tsx index 23cd6cbc7..16e9762a9 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -205,8 +205,13 @@ export default class Input extends Component { ) : null; + // https://github.com/ant-design/ant-design/issues/6144 + const affixWrapperClassName = classNames(`${props.prefixCls}-affix-wrapper`, { + [`${props.prefixCls}-affix-wrapper-has-height`]: (props.style && 'height' in props.style), + }); + return ( - + {prefix} {cloneElement(children, { style: null })} {suffix} diff --git a/components/input/style/index.less b/components/input/style/index.less index 546189157..768593049 100644 --- a/components/input/style/index.less +++ b/components/input/style/index.less @@ -16,4 +16,9 @@ // Input with affix: prefix or suffix .@{ant-prefix}-input-affix-wrapper { .input-affix-wrapper(~"@{ant-prefix}-input"); + + // https://github.com/ant-design/ant-design/issues/6144 + .@{ant-prefix}-input { + height: 100%; + } }