diff --git a/superset-frontend/src/explore/components/controls/AnnotationLayer.jsx b/superset-frontend/src/explore/components/controls/AnnotationLayer.jsx index 20fdaecc914..e119e87423f 100644 --- a/superset-frontend/src/explore/components/controls/AnnotationLayer.jsx +++ b/superset-frontend/src/explore/components/controls/AnnotationLayer.jsx @@ -240,12 +240,16 @@ export default class AnnotationLayer extends React.PureComponent { } handleAnnotationSourceType(sourceType) { - this.setState({ - sourceType, - isLoadingOptions: true, - validationErrors: {}, - value: null, - }); + const { sourceType: prevSourceType } = this.state; + + if (prevSourceType !== sourceType) { + this.setState({ + sourceType, + isLoadingOptions: true, + validationErrors: {}, + value: null, + }); + } } handleValue(value) { diff --git a/superset-frontend/src/explore/components/controls/SelectControl.jsx b/superset-frontend/src/explore/components/controls/SelectControl.jsx index 968bc076670..b858342a0e3 100644 --- a/superset-frontend/src/explore/components/controls/SelectControl.jsx +++ b/superset-frontend/src/explore/components/controls/SelectControl.jsx @@ -96,6 +96,8 @@ export default class SelectControl extends React.PureComponent { } } + // Beware: This is acting like an on-click instead of an on-change + // (firing every time user chooses vs firing only if a new option is chosen). onChange(opt) { let optionValue = null; if (opt) {