Browse Source

fix(nc-gui): disable autofocus json field in form view

pull/7786/head
Ramesh Mane 4 months ago
parent
commit
18c352c4b3
  1. 1
      packages/nc-gui/components/cell/Json.vue
  2. 13
      packages/nc-gui/components/monaco/Editor.vue

1
packages/nc-gui/components/cell/Json.vue

@ -184,6 +184,7 @@ watch(isExpanded, () => {
:class="{ 'expanded-editor': isExpanded, 'editor': !isExpanded }"
:hide-minimap="true"
:disable-deep-compare="true"
:auto-focus="!isForm"
@update:model-value="localValue = $event"
@keydown.enter.stop
/>

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

@ -12,9 +12,18 @@ interface Props {
validate?: boolean
disableDeepCompare?: boolean
readOnly?: boolean
autoFocus: boolean
}
const { hideMinimap, lang = 'json', validate = true, disableDeepCompare = false, modelValue, readOnly } = defineProps<Props>()
const {
hideMinimap,
lang = 'json',
validate = true,
disableDeepCompare = false,
modelValue,
readOnly,
autoFocus = true,
} = defineProps<Props>()
const emits = defineEmits(['update:modelValue'])
@ -120,7 +129,7 @@ onMounted(async () => {
}
})
if (!isDrawerOrModalExist()) {
if (!isDrawerOrModalExist() && autoFocus) {
// auto focus on json cells only
editor.focus()
}

Loading…
Cancel
Save