From 632d2e87bfef6cca3c8c212f9aedffd1a47f702e Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:03:59 +1100 Subject: [PATCH] [8.x] [ES|QL] Fix editor cursor jumpiness (#202389) (#202850) # Backport This will backport the following commits from `main` to `8.x`: - [[ES|QL] Fix editor cursor jumpiness (#202389)](https://github.com/elastic/kibana/pull/202389) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Davis McPhee --- packages/kbn-esql-editor/src/esql_editor.tsx | 4 +++- packages/kbn-esql-editor/src/overwrite.scss | 14 +++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/kbn-esql-editor/src/esql_editor.tsx b/packages/kbn-esql-editor/src/esql_editor.tsx index 767bc9026348c..eb3da01abd505 100644 --- a/packages/kbn-esql-editor/src/esql_editor.tsx +++ b/packages/kbn-esql-editor/src/esql_editor.tsx @@ -585,7 +585,7 @@ export const ESQLEditor = memo(function ESQLEditor({ lightbulb: { enabled: false, }, - lineDecorationsWidth: 12, + lineDecorationsWidth: 20, lineNumbers: 'on', lineNumbersMinChars: 3, minimap: { enabled: false }, @@ -601,7 +601,9 @@ export const ESQLEditor = memo(function ESQLEditor({ renderLineHighlightOnlyWhenFocus: true, scrollbar: { horizontal: 'hidden', + horizontalScrollbarSize: 6, vertical: 'auto', + verticalScrollbarSize: 6, }, scrollBeyondLastLine: false, theme: darkMode ? ESQL_DARK_THEME_ID : ESQL_LIGHT_THEME_ID, diff --git a/packages/kbn-esql-editor/src/overwrite.scss b/packages/kbn-esql-editor/src/overwrite.scss index 0f675c02cd768..9e716b55f3e2b 100644 --- a/packages/kbn-esql-editor/src/overwrite.scss +++ b/packages/kbn-esql-editor/src/overwrite.scss @@ -29,15 +29,11 @@ @include euiTextBreakWord; } -// All scrollable containers (e.g. main container and suggest menu) -.ESQLEditor .monaco-editor .monaco-scrollable-element { - margin-left: $euiSizeS; +// Space between the autocomplete menu and expanded suggestion details +.ESQLEditor .monaco-editor .suggest-details { + padding-left: $euiSizeS; } -.ESQLEditor .monaco-editor .monaco-list .monaco-scrollable-element { - margin-left: 0; - - .monaco-list-row.focused { - border-radius: $euiBorderRadius; - } +.ESQLEditor .monaco-editor .monaco-list .monaco-scrollable-element .monaco-list-row.focused { + border-radius: $euiBorderRadius; } \ No newline at end of file