This is an automated email from the ASF dual-hosted git repository.
beto pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new e767e4d Fix <Select> clearable (#7215)
e767e4d is described below
commit e767e4d9ef7b996f8701b8eccd2f0c1ae8ab591f
Author: Maxime Beauchemin <[email protected]>
AuthorDate: Wed Apr 3 13:25:49 2019 -0700
Fix <Select> clearable (#7215)
closes https://github.com/apache/incubator-superset/issues/7213
related to
https://github.com/apache/incubator-superset/pull/6722#issuecomment-479366738
---
.../explore/components/controls/SelectControl.jsx | 33 +++++++++++-----------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/superset/assets/src/explore/components/controls/SelectControl.jsx
b/superset/assets/src/explore/components/controls/SelectControl.jsx
index e15bf7a..906d867 100644
--- a/superset/assets/src/explore/components/controls/SelectControl.jsx
+++ b/superset/assets/src/explore/components/controls/SelectControl.jsx
@@ -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);
}