From 414a116f94fc52bab2f0b681d042a6238e97ca86 Mon Sep 17 00:00:00 2001 From: lana-k Date: Wed, 19 May 2021 22:50:56 +0200 Subject: [PATCH] Lost focus in SQL query editor #54 --- .../Main/Editor/Tabs/Tab/SqlEditor/index.vue | 8 +++++--- src/views/Main/Editor/Tabs/Tab/index.vue | 16 +++++++++------- tests/lib/utils/fileIo.spec.js | 2 +- tests/views/MainView/Editor/Tabs/Tab/Tab.spec.js | 1 + 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/views/Main/Editor/Tabs/Tab/SqlEditor/index.vue b/src/views/Main/Editor/Tabs/Tab/SqlEditor/index.vue index 23721f4..6a28394 100644 --- a/src/views/Main/Editor/Tabs/Tab/SqlEditor/index.vue +++ b/src/views/Main/Editor/Tabs/Tab/SqlEditor/index.vue @@ -1,6 +1,6 @@ @@ -28,7 +28,6 @@ export default { theme: 'neo', lineNumbers: true, line: true, - autofocus: true, autoRefresh: true, extraKeys: { 'Ctrl-Space': showHintOnDemand } } @@ -40,7 +39,10 @@ export default { } }, methods: { - onChange: debounce(showHint, 400) + onChange: debounce(showHint, 400), + focus () { + this.$refs.cm.codemirror.focus() + } } } diff --git a/src/views/Main/Editor/Tabs/Tab/index.vue b/src/views/Main/Editor/Tabs/Tab/index.vue index c97efa9..8ff8ae9 100644 --- a/src/views/Main/Editor/Tabs/Tab/index.vue +++ b/src/views/Main/Editor/Tabs/Tab/index.vue @@ -8,7 +8,7 @@ >