fix(editor): allow checking a checkbox even when the editor is set to read only
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2023-10-22 13:26:01 +02:00
parent 32ca8853bc
commit 0154b2a475
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 11 additions and 0 deletions

View File

@ -160,6 +160,7 @@ import {Paragraph} from '@tiptap/extension-paragraph'
import {Strike} from '@tiptap/extension-strike'
import {Text} from '@tiptap/extension-text'
import {BubbleMenu, EditorContent, useEditor} from '@tiptap/vue-3'
import {Node} from '@tiptap/pm/model'
import Commands from './commands'
import suggestionSetup from './suggestion'
@ -385,6 +386,16 @@ const editor = useEditor({
TaskList,
TaskItem.configure({
nested: true,
onReadOnlyChecked: (node: Node, checked: boolean): boolean => {
if (isEditEnabled) {
node.attrs.checked = checked
inputHTML.value = editor.value?.getHTML()
bubbleSave()
return true
}
return false
},
}),
Commands.configure({