fix: 🐛
This commit is contained in:
parent
a710e40747
commit
53e9aea82f
2 changed files with 9 additions and 5 deletions
|
|
@ -82,9 +82,13 @@ export const ClipboardAndDropHandler = Extension.create<ClipboardAndDropHandlerO
|
|||
if (i > 0) nodes.push(schema.nodes.hardBreak.create())
|
||||
if (parts[i]) nodes.push(schema.text(parts[i]))
|
||||
}
|
||||
const fragment = schema.nodes.paragraph.create(null, nodes)
|
||||
const tr = view.state.tr.replaceSelectionWith(fragment)
|
||||
view.dispatch(tr)
|
||||
if (nodes.length > 0) {
|
||||
const tr = view.state.tr.replaceSelectionWith(nodes[0])
|
||||
for (let i = 1; i < nodes.length; i++) {
|
||||
tr.insert(tr.selection.from, nodes[i])
|
||||
}
|
||||
view.dispatch(tr)
|
||||
}
|
||||
})
|
||||
handled = true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue