Browse Source

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

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

5
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,8 +118,11 @@ onMounted(async () => {
} }
}) })
if (!isDrawerOrModalExist()) {
// auto focus on json cells only
editor.focus() editor.focus()
} }
}
}) })
watch($$(vModel), (v) => { watch($$(vModel), (v) => {

Loading…
Cancel
Save