Browse Source

chore(nc-gui): small changes

pull/7741/head
Ramesh Mane 8 months ago
parent
commit
6a64daf22c
  1. 13
      packages/nc-gui/components/cell/RichText.vue
  2. 4
      packages/nc-gui/components/cell/RichText/SelectedBubbleMenu.vue

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

@ -140,9 +140,10 @@ const editor = useEditor({
onFocus: () => {
isFocused.value = true
},
onBlur: () => {
onBlur: (e) => {
if (props.isTabPressed) {
isFocused.value = false
e?.editor?.setEditable(false)
}
},
})
@ -173,16 +174,6 @@ const setEditorContent = (contentMd: any, focusEndOfDoc?: boolean) => {
}, 100)
}
if (props.isFormField) {
watch([props, editor], () => {
if (props.readOnly) {
editor.value?.setEditable(false)
} else {
editor.value?.setEditable(true)
}
})
}
if (props.syncValueChange) {
watch([vModel, editor], () => {
setEditorContent(vModel.value)

4
packages/nc-gui/components/cell/RichText/SelectedBubbleMenu.vue

@ -19,9 +19,7 @@ interface Props {
const props = defineProps<Props>()
const editor = computed(() => props.editor)
const embedMode = computed(() => props.embedMode)
const { editor, embedMode } = toRefs(props)
const cmdOrCtrlKey = computed(() => {
return isMac() ? '⌘' : 'CTRL'

Loading…
Cancel
Save