Browse Source

chore(nc-gui): small changes

pull/7741/head
Ramesh Mane 9 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: () => { onFocus: () => {
isFocused.value = true isFocused.value = true
}, },
onBlur: () => { onBlur: (e) => {
if (props.isTabPressed) { if (props.isTabPressed) {
isFocused.value = false isFocused.value = false
e?.editor?.setEditable(false)
} }
}, },
}) })
@ -173,16 +174,6 @@ const setEditorContent = (contentMd: any, focusEndOfDoc?: boolean) => {
}, 100) }, 100)
} }
if (props.isFormField) {
watch([props, editor], () => {
if (props.readOnly) {
editor.value?.setEditable(false)
} else {
editor.value?.setEditable(true)
}
})
}
if (props.syncValueChange) { if (props.syncValueChange) {
watch([vModel, editor], () => { watch([vModel, editor], () => {
setEditorContent(vModel.value) setEditorContent(vModel.value)

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

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

Loading…
Cancel
Save