From: Yarin Dekel Date: Thu, 29 Nov 2018 08:24:07 +0000 (+0200) Subject: onbaording search visibility X-Git-Tag: 1.4.0~180 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=42b83b0b7a51849671cfa4718b55cbf7fe2df8a2;p=sdc.git onbaording search visibility Issue-ID: SDC-1963 Change-Id: I2e40deb35970c848422c471114fccf2bb5c331e2 Signed-off-by: Yarin Dekel --- diff --git a/openecomp-ui/src/nfvo-components/input/ExpandableInput.jsx b/openecomp-ui/src/nfvo-components/input/ExpandableInput.jsx index 3973ae8c5d..be0ebf2bdd 100644 --- a/openecomp-ui/src/nfvo-components/input/ExpandableInput.jsx +++ b/openecomp-ui/src/nfvo-components/input/ExpandableInput.jsx @@ -95,11 +95,16 @@ class ExpandableInput extends React.Component { value: PropTypes.string }; - state = { showInput: false }; + constructor(props) { + super(props); + this.state = { + showInput: !!props.value || false + }; + } - closeInput() { - if (!this.props.value) { - this.setState({ showInput: false }); + showInputChange() { + if (this.props.value) { + this.setState({ showInput: true }); } } @@ -118,7 +123,7 @@ class ExpandableInput extends React.Component { onChange={onChange} value={value} handleKeyDown={e => this.handleKeyDown(e)} - handleBlur={() => this.closeInput()} + handleBlur={() => this.showInputChange()} /> )} {!this.state.showInput && (