From d3881620b8a099ed3215f4906dab6678d2b72d01 Mon Sep 17 00:00:00 2001 From: Vasek Mlejnsky Date: Mon, 3 Sep 2018 10:49:38 +0200 Subject: [PATCH] Add disable state for Input --- src/components/inputs/Input/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/inputs/Input/index.js b/src/components/inputs/Input/index.js index f683cb82..65d1591b 100644 --- a/src/components/inputs/Input/index.js +++ b/src/components/inputs/Input/index.js @@ -48,6 +48,7 @@ const StyledInput = styled.input` background-color: ${colors.WHITE}; transition: ${TRANSITION.HOVER}; &:disabled { + pointer-events: none; background: ${colors.GRAY_LIGHT}; color: ${colors.TEXT_SECONDARY}; } @@ -117,6 +118,7 @@ class Input extends Component { value={this.props.value} onChange={this.props.onChange} borderColor={this.getColor(this.props.state)} + disabled={this.props.isDisabled} /> {this.props.sideAddons && this.props.sideAddons.map(sideAddon => sideAddon)} @@ -147,6 +149,7 @@ Input.propTypes = { bottomText: PropTypes.string, inputLabel: PropTypes.string, sideAddons: PropTypes.arrayOf(PropTypes.node), + isDisabled: PropTypes.bool, }; Input.defaultProps = {