Browse Source

fix(nc-gui): auto focus on json cells only

pull/4482/head
Wing-Kam Wong 2 years ago
parent
commit
8e3a666348
  1. 7
      packages/nc-gui/components/monaco/Editor.vue

7
packages/nc-gui/components/monaco/Editor.vue

@ -3,7 +3,7 @@ import JsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'
import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker' import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
import TypescriptWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker' import TypescriptWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
import type { editor as MonacoEditor } from 'monaco-editor' import type { editor as MonacoEditor } from 'monaco-editor'
import { deepCompare, onMounted, ref, watch } from '#imports' import { deepCompare, onMounted, ref, watch, isDrawerOrModalExist } from '#imports'
interface Props { interface Props {
modelValue: string | Record<string, any> modelValue: string | Record<string, any>
@ -118,7 +118,10 @@ onMounted(async () => {
} }
}) })
editor.focus() if (!isDrawerOrModalExist()) {
// auto focus on json cells only
editor.focus()
}
} }
}) })

Loading…
Cancel
Save