diff --git a/public/app/core/components/code_editor/code_editor.ts b/public/app/core/components/code_editor/code_editor.ts index 151ebffab5d..826d62eaade 100644 --- a/public/app/core/components/code_editor/code_editor.ts +++ b/public/app/core/components/code_editor/code_editor.ts @@ -110,6 +110,9 @@ function link(scope, elem, attrs) { elem.addClass("gf-code-editor"); let textarea = elem.find("textarea"); textarea.addClass('gf-form-input'); + if (attrs.giveFocus) { + textarea.attr('give-focus', attrs.giveFocus); + } // Event handlers editorSession.on('change', (e) => { diff --git a/public/app/plugins/datasource/prometheus/partials/query.editor.html b/public/app/plugins/datasource/prometheus/partials/query.editor.html index 5140c9e7bbd..9b2aa533743 100644 --- a/public/app/plugins/datasource/prometheus/partials/query.editor.html +++ b/public/app/plugins/datasource/prometheus/partials/query.editor.html @@ -2,7 +2,7 @@