Compare commits
2 Commits
main
...
fix/tiptap
Author | SHA1 | Date | |
---|---|---|---|
c82e5fb235 | |||
e5e8e8d134 |
|
@ -389,7 +389,20 @@ const editor = useEditor({
|
|||
CustomImage,
|
||||
|
||||
TaskList,
|
||||
TaskItem.configure({
|
||||
TaskItem.extend({
|
||||
addAttributes() {
|
||||
return {
|
||||
...this.parent?.(),
|
||||
id: {
|
||||
default: () => createRandomID(),
|
||||
parseHTML: element => element.getAttribute('data-id'),
|
||||
renderHTML: attributes => ({
|
||||
'data-id': attributes.id,
|
||||
}),
|
||||
},
|
||||
}
|
||||
},
|
||||
}).configure({
|
||||
nested: true,
|
||||
onReadOnlyChecked: (node: Node, checked: boolean): boolean => {
|
||||
if (!isEditEnabled) {
|
||||
|
@ -401,7 +414,7 @@ const editor = useEditor({
|
|||
// https://github.com/ueberdosis/tiptap/issues/3676
|
||||
|
||||
editor.value!.state.doc.descendants((subnode, pos) => {
|
||||
if (node.eq(subnode)) {
|
||||
if (node.attrs.id === subnode.attrs.id) {
|
||||
const {tr} = editor.value!.state
|
||||
tr.setNodeMarkup(pos, undefined, {
|
||||
...node.attrs,
|
||||
|
@ -409,10 +422,10 @@ const editor = useEditor({
|
|||
})
|
||||
editor.value!.view.dispatch(tr)
|
||||
bubbleSave()
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
return true
|
||||
},
|
||||
}),
|
||||
|
@ -597,7 +610,7 @@ watch(
|
|||
() => isEditing.value,
|
||||
async editing => {
|
||||
await nextTick()
|
||||
|
||||
|
||||
let checkboxes = tiptapInstanceRef.value?.querySelectorAll('[data-checked]')
|
||||
if (typeof checkboxes === 'undefined' || checkboxes.length === 0) {
|
||||
// For some reason, this works when we check a second time.
|
||||
|
|
Loading…
Reference in New Issue
Block a user