diff --git a/packages/kbn-esql-editor/src/esql_editor.tsx b/packages/kbn-esql-editor/src/esql_editor.tsx index 337c0133e7d20..1e8312e5d6a7e 100644 --- a/packages/kbn-esql-editor/src/esql_editor.tsx +++ b/packages/kbn-esql-editor/src/esql_editor.tsx @@ -711,6 +711,10 @@ export const ESQLEditor = memo(function ESQLEditor({ }); editor.onDidChangeModelContent(showSuggestionsIfEmptyQuery); + + // Auto-focus the editor and move the cursor to the end. + editor.focus(); + editor.setPosition({ column: Infinity, lineNumber: Infinity }); }} />