Maxime Beauchemin 2019-04-03 13:25:49 -07:00 committed by Beto Dealmeida
parent 8830d3f96e
commit e767e4d9ef
1 changed files with 16 additions and 17 deletions

View File

@ -92,25 +92,24 @@ export default class SelectControl extends React.PureComponent {
onChange(opt) {
let optionValue = null;
if (!opt) {
return;
}
if (this.props.multi) {
optionValue = [];
for (const o of opt) {
if (o.meta === true) {
optionValue = this.getOptions(this.props)
.filter(x => !x.meta)
.map(x => x[this.props.valueKey]);
break;
} else {
optionValue.push(o[this.props.valueKey]);
if (opt) {
if (this.props.multi) {
optionValue = [];
for (const o of opt) {
if (o.meta === true) {
optionValue = this.getOptions(this.props)
.filter(x => !x.meta)
.map(x => x[this.props.valueKey]);
break;
} else {
optionValue.push(o[this.props.valueKey]);
}
}
} else if (opt.meta === true) {
return;
} else {
optionValue = opt[this.props.valueKey];
}
} else if (opt.meta === true) {
return;
} else {
optionValue = opt[this.props.valueKey];
}
this.props.onChange(optionValue);
}