mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix issue with deleting a query (empty string not updating)
This commit is contained in:
parent
bbaa5b63c8
commit
21ee85b1e2
@ -257,6 +257,14 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
|
||||
};
|
||||
|
||||
onChangeQuery = (value: DataQuery, index: number, override?: boolean) => {
|
||||
// Null value means reset
|
||||
if (value === null) {
|
||||
value = { ...generateQueryKeys(index) };
|
||||
}
|
||||
|
||||
// Keep current value in local cache
|
||||
this.modifiedQueries[index] = value;
|
||||
|
||||
if (override) {
|
||||
this.setState(state => {
|
||||
// Replace query row by injecting new key
|
||||
@ -277,9 +285,6 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
|
||||
queryTransactions: nextQueryTransactions,
|
||||
};
|
||||
}, this.onSubmit);
|
||||
} else if (value) {
|
||||
// Keep current value in local cache
|
||||
this.modifiedQueries[index] = value;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user