aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/nfvo-components/input/dualListbox
diff options
context:
space:
mode:
authorEinav Weiss Keidar <einavw@amdocs.com>2018-08-13 16:19:46 +0300
committerAvi Gaffa <avi.gaffa@amdocs.com>2019-02-11 13:50:22 +0000
commit1801b24389baa8e3f7298ff2c41e2512b19c1290 (patch)
treed3d2a15f53aa28698280d609548298d177f9280d /openecomp-ui/src/nfvo-components/input/dualListbox
parentaf8e36eb7f43803bd9cf40e9b46a0c0c8f47c781 (diff)
react 16 upgrade
Issue-ID: SDC-1762 Change-Id: I7701f12fc63bb09f8c985c7c893b984701dcbfab Signed-off-by: Einav Keidar <einavw@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/nfvo-components/input/dualListbox')
-rw-r--r--openecomp-ui/src/nfvo-components/input/dualListbox/DualListboxView.jsx23
1 files changed, 18 insertions, 5 deletions
diff --git a/openecomp-ui/src/nfvo-components/input/dualListbox/DualListboxView.jsx b/openecomp-ui/src/nfvo-components/input/dualListbox/DualListboxView.jsx
index f36d999249..21f09e6613 100644
--- a/openecomp-ui/src/nfvo-components/input/dualListbox/DualListboxView.jsx
+++ b/openecomp-ui/src/nfvo-components/input/dualListbox/DualListboxView.jsx
@@ -16,9 +16,16 @@
import React from 'react';
import PropTypes from 'prop-types';
import SVGIcon from 'sdc-ui/lib/react/SVGIcon.js';
-import Input from 'nfvo-components/input/validation/InputWrapper.jsx';
+import Input from 'nfvo-components/input/validation/Input.jsx';
class DualListboxView extends React.Component {
+ constructor(props) {
+ super(props);
+ this.availableListRef = React.createRef();
+ this.availableListFilterRef = React.createRef();
+ this.selectedValuesListFilterRef = React.createRef();
+ this.selectedValuesRef = React.createRef();
+ }
static propTypes = {
availableList: PropTypes.arrayOf(
PropTypes.shape({
@@ -77,13 +84,13 @@ class DualListboxView extends React.Component {
unselectedList,
{
value: availableListFilter,
- ref: 'availableListFilter',
+ ref: this.availableListFilterRef,
disabled: isReadOnlyMode,
onChange: value =>
this.setState({ availableListFilter: value })
},
{
- ref: 'availableValues',
+ ref: this.availableListRef,
disabled: isReadOnlyMode,
testId: 'available'
}
@@ -94,13 +101,13 @@ class DualListboxView extends React.Component {
selectedList,
{
value: selectedValuesListFilter,
- ref: 'selectedValuesListFilter',
+ ref: this.selectedValuesListFilterRef,
disabled: isReadOnlyMode,
onChange: value =>
this.setState({ selectedValuesListFilter: value })
},
{
- ref: 'selectedValues',
+ ref: this.selectedValuesRef,
disabled: isReadOnlyMode,
testId: 'selected'
}
@@ -236,6 +243,12 @@ class DualListboxView extends React.Component {
removeAllFromSelectedList() {
this.props.onChange([]);
}
+
+ // fix for auto-selection of first value in the list on the first render
+ componentDidMount() {
+ this.availableListRef.current.input.value = '';
+ this.selectedValuesRef.current.input.value = '';
+ }
}
export default DualListboxView;