diff --git a/public/app/plugins/datasource/influxdb/components/InfluxLogsQueryField.tsx b/public/app/plugins/datasource/influxdb/components/InfluxLogsQueryField.tsx index 70fd5a74da3..2d4f01dcbe6 100644 --- a/public/app/plugins/datasource/influxdb/components/InfluxLogsQueryField.tsx +++ b/public/app/plugins/datasource/influxdb/components/InfluxLogsQueryField.tsx @@ -63,6 +63,12 @@ export class InfluxLogsQueryField extends React.PureComponent { this.setState({ measurements }); } + componentDidUpdate(prevProps: Props) { + if (prevProps.query.measurement && !this.props.query.measurement) { + this.setState({ measurement: null, field: null }); + } + } + onMeasurementsChange = async (values: string[]) => { const { query } = this.props; const measurement = values[0]; @@ -105,7 +111,7 @@ export class InfluxLogsQueryField extends React.PureComponent { return (
- +