mirror of
https://github.com/wahyd4/ant-design.git
synced 2026-08-09 04:46:52 +10:00
Fix style.height issue of Input with addon and prefix, close #6144
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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%;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user