Skip to content

Commit 32f3192

Browse files
author
vikasrohit
authored
Merge pull request #1272 from appirio-tech/feature/mobility-testing
mobility testing added to the catalogue
2 parents be46e63 + 83e5611 commit 32f3192

File tree

7 files changed

+526
-17
lines changed

7 files changed

+526
-17
lines changed

src/components/SelectDropdown/SelectDropdown.jsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,19 @@ class SelectDropdown extends Component {
1212
}
1313

1414
componentWillMount() {
15+
let selectedOption = _.find(this.props.options, (o) => o.value === this.props.value)
16+
if (!selectedOption) {
17+
selectedOption = this.props.options[0]
18+
}
1519
this.setState({
16-
selectedOption: this.props.selectedOption || this.props.options[0]
17-
}, function() {
18-
this.props.setValue(this.state.selectedOption)
19-
})
20+
selectedOption
21+
}/*, function() {
22+
// FIXME intentionally commented because it was causing multiple renders when used in mobility testing template
23+
// Need to further analyze
24+
// It does not seem to add any value either in both of its usage (it is used in App Screens section
25+
// for design projects and in mobility testing projects)
26+
this.props.setValue(this.state.selectedOption.value)
27+
}*/)
2028
}
2129

2230
handleClick(option) {
@@ -25,7 +33,7 @@ class SelectDropdown extends Component {
2533
this.props.onSelect(this.state.selectedOption)
2634
}
2735
})
28-
this.props.setValue(option)
36+
this.props.setValue(option.value)
2937
}
3038

3139
render() {

0 commit comments

Comments
 (0)