diff --git a/public/app/features/templating/DefaultVariableQueryEditor.tsx b/public/app/features/templating/DefaultVariableQueryEditor.tsx index e361d76bcc9..90ad322d59e 100644 --- a/public/app/features/templating/DefaultVariableQueryEditor.tsx +++ b/public/app/features/templating/DefaultVariableQueryEditor.tsx @@ -1,5 +1,4 @@ import React, { PureComponent } from 'react'; -import { Input } from '@grafana/ui'; import { VariableQueryProps } from 'app/types/plugins'; export default class DefaultVariableQueryEditor extends PureComponent { @@ -8,20 +7,30 @@ export default class DefaultVariableQueryEditor extends PureComponent) => { + onChange = (event: React.FormEvent) => { this.setState({ value: event.currentTarget.value }); }; - onBlur = (event: React.FormEvent) => { + onBlur = (event: React.FormEvent) => { this.props.onChange(event.currentTarget.value, event.currentTarget.value); }; + getLineCount() { + const { value } = this.state; + + if (typeof value === 'string') { + return value.split('\n').length; + } + + return 1; + } + render() { return (
Query -