web: components: fix InputBlock

This commit is contained in:
NikolayRechkin 2019-08-27 09:22:28 +03:00
parent 8677d3c236
commit d87ed5b532

View File

@ -45,9 +45,9 @@ const StyledInputGroup = styled(CustomInputGroup)`
const InputBlock = React.forwardRef((props, ref) => {
//console.log("InputBlock render");
const { onChange, value, children, size } = props;
let iconButtonSize = 0;
if (typeof props.iconSize == "number" && props.iconSize > 0) {
iconButtonSize = props.iconSize;
} else {
@ -82,6 +82,9 @@ const InputBlock = React.forwardRef((props, ref) => {
</StyledChildrenBlock>
</InputGroupAddon>
<TextInput
id={props.id}
name={props.name}
type={props.type}
value={value}
isDisabled={props.isDisabled}
hasError={props.hasError}
@ -105,13 +108,13 @@ const InputBlock = React.forwardRef((props, ref) => {
&&
<InputGroupAddon addonType="append">
<StyledIconBlock>
<IconButton
size={iconButtonSize}
color={props.iconColor}
iconName={props.iconName}
isFill={props.isIconFill}
isDisabled={props.isDisabled}
onClick={typeof props.onIconClick == 'function' ? onIconClick : undefined } />
<IconButton
size={iconButtonSize}
color={props.iconColor}
iconName={props.iconName}
isFill={props.isIconFill}
isDisabled={props.isDisabled}
onClick={typeof props.onIconClick == 'function' ? onIconClick : undefined} />
</StyledIconBlock>
</InputGroupAddon>
}