diff --git a/public/app/plugins/datasource/stackdriver/components/AliasBy.tsx b/public/app/plugins/datasource/stackdriver/components/AliasBy.tsx index 54200452325..c3445053627 100644 --- a/public/app/plugins/datasource/stackdriver/components/AliasBy.tsx +++ b/public/app/plugins/datasource/stackdriver/components/AliasBy.tsx @@ -11,9 +11,11 @@ export interface State { } export class AliasBy extends Component { + propagateOnChange: (value) => void; + constructor(props) { super(props); - this.updateQuery = debounce(this.updateQuery.bind(this), 500); + this.propagateOnChange = debounce(this.props.onChange, 500); this.state = { value: '' }; } @@ -29,16 +31,12 @@ export class AliasBy extends Component { onChange(e) { this.setState({ value: e.target.value }); - this.updateQuery(e.target.value); - } - - updateQuery(value) { - this.props.onChange(value); + this.propagateOnChange(e.target.value); } render() { return ( - + <>
@@ -53,7 +51,7 @@ export class AliasBy extends Component {
- + ); } }