fix(editor): allow checking a checkbox even when the editor is set to read only
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
32ca8853bc
commit
0154b2a475
|
@ -160,6 +160,7 @@ import {Paragraph} from '@tiptap/extension-paragraph'
|
||||||
import {Strike} from '@tiptap/extension-strike'
|
import {Strike} from '@tiptap/extension-strike'
|
||||||
import {Text} from '@tiptap/extension-text'
|
import {Text} from '@tiptap/extension-text'
|
||||||
import {BubbleMenu, EditorContent, useEditor} from '@tiptap/vue-3'
|
import {BubbleMenu, EditorContent, useEditor} from '@tiptap/vue-3'
|
||||||
|
import {Node} from '@tiptap/pm/model'
|
||||||
|
|
||||||
import Commands from './commands'
|
import Commands from './commands'
|
||||||
import suggestionSetup from './suggestion'
|
import suggestionSetup from './suggestion'
|
||||||
|
@ -385,6 +386,16 @@ const editor = useEditor({
|
||||||
TaskList,
|
TaskList,
|
||||||
TaskItem.configure({
|
TaskItem.configure({
|
||||||
nested: true,
|
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({
|
Commands.configure({
|
||||||
|
|
Reference in New Issue