Browse Source

fix: avoid focus to rich text unless it is expanded (#8438)

Co-authored-by: mertmit <mertmit99@gmail.com>
pull/8445/head
Raju Udava 6 months ago committed by GitHub
parent
commit
43b8006a5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 18
      packages/nc-gui/components/cell/RichText.vue

18
packages/nc-gui/components/cell/RichText.vue

@ -32,7 +32,7 @@ const props = withDefaults(
const emits = defineEmits(['update:value', 'focus', 'blur'])
const { isFormField, hiddenBubbleMenuOptions } = toRefs(props)
const { fullMode, isFormField, hiddenBubbleMenuOptions } = toRefs(props)
const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))!
@ -219,16 +219,16 @@ if (isFormField.value) {
})
}
watch(editorDom, () => {
if (!editorDom.value) return
onMounted(() => {
if (fullMode.value) {
setEditorContent(vModel.value, true)
setEditorContent(vModel.value, true)
if ((isForm.value && !isSurveyForm.value) || isFormField.value) return
if ((isForm.value && !isSurveyForm.value) || isFormField.value) return
// Focus editor after editor is mounted
setTimeout(() => {
editor.value?.chain().focus().run()
}, 50)
nextTick(() => {
editor.value?.chain().focus().run()
})
}
})
useEventListener(

Loading…
Cancel
Save