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%; + } }