Fix "Select all" option in SelectControl (#11692)

This commit is contained in:
Kamil Gabryjelski 2020-11-17 02:23:32 +01:00 committed by GitHub
parent 274420bc5a
commit 8a39f2799a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,11 +109,9 @@ export default class SelectControl extends React.PureComponent {
opt.forEach(o => { opt.forEach(o => {
// select all options // select all options
if (o.meta === true) { if (o.meta === true) {
this.props.onChange( optionValue = this.getOptions(this.props)
this.getOptions(this.props) .filter(x => !x.meta)
.filter(x => !x.meta) .map(x => x[this.props.valueKey]);
.map(x => x[this.props.valueKey]),
);
return; return;
} }
optionValue.push(o[this.props.valueKey] || o); optionValue.push(o[this.props.valueKey] || o);