Fix style.height issue of Input with addon and prefix, close #6144

This commit is contained in:
afc163
2017-05-15 18:15:58 +08:00
parent a9a8f68578
commit 010860ae0f
2 changed files with 11 additions and 1 deletions
+6 -1
View File
@@ -205,8 +205,13 @@ export default class Input extends Component<InputProps & HTMLInputProps, any> {
</span>
) : 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 (
<span className={`${props.prefixCls}-affix-wrapper`} style={props.style}>
<span className={affixWrapperClassName} style={props.style}>
{prefix}
{cloneElement(children, { style: null })}
{suffix}
+5
View File
@@ -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%;
}
}