Fix chart annotation source type showing perpetual loading when re-selecting the same value. (#10036)

Remove accidental console.log used during testing.

Co-authored-by: Natalie Ruhe <natalie@preset.io>
This commit is contained in:
Natalie Ruhe
2020-06-10 16:17:56 -07:00
committed by GitHub
parent 36627af916
commit d1588c7658
2 changed files with 12 additions and 6 deletions

View File

@@ -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) {

View File

@@ -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) {