mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix to focus first query
This commit is contained in:
@@ -110,7 +110,7 @@ function link(scope, elem, attrs) {
|
||||
elem.addClass("gf-code-editor");
|
||||
let textarea = elem.find("textarea");
|
||||
textarea.addClass('gf-form-input');
|
||||
if (attrs.giveFocus) {
|
||||
if (scope.focus) {
|
||||
setTimeout(function () {
|
||||
textarea.focus();
|
||||
var domEl = textarea[0];
|
||||
@@ -209,6 +209,7 @@ export function codeEditorDirective() {
|
||||
template: editorTemplate,
|
||||
scope: {
|
||||
content: "=",
|
||||
focus: "=",
|
||||
onChange: "&",
|
||||
getCompleter: "&"
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="gf-form-inline">
|
||||
<div class="gf-form gf-form--grow">
|
||||
<code-editor content="ctrl.target.expr" on-change="ctrl.refreshMetricData()"
|
||||
get-completer="ctrl.getCompleter()" data-mode="prometheus" give-focus="ctrl.target.refId == 'A'">
|
||||
get-completer="ctrl.getCompleter()" data-mode="prometheus" focus="ctrl.target.refId == 'A'">
|
||||
</code-editor>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user