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. 14
      packages/nc-gui/components/cell/RichText.vue

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

@ -32,7 +32,7 @@ const props = withDefaults(
const emits = defineEmits(['update:value', 'focus', 'blur']) const emits = defineEmits(['update:value', 'focus', 'blur'])
const { isFormField, hiddenBubbleMenuOptions } = toRefs(props) const { fullMode, isFormField, hiddenBubbleMenuOptions } = toRefs(props)
const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))! const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))!
@ -219,16 +219,16 @@ if (isFormField.value) {
}) })
} }
watch(editorDom, () => { onMounted(() => {
if (!editorDom.value) return 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(() => { nextTick(() => {
editor.value?.chain().focus().run() editor.value?.chain().focus().run()
}, 50) })
}
}) })
useEventListener( useEventListener(

Loading…
Cancel
Save