From 0b3d353e58926c5ae5e7e96a11e2ace94fef6d3d Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Tue, 25 Apr 2023 22:17:28 +0600 Subject: [PATCH] Fix mention paste (#3075) Signed-off-by: Denis Bykhov --- packages/text-editor/src/Completion.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/text-editor/src/Completion.ts b/packages/text-editor/src/Completion.ts index 4c17f03aa0..f648728fb6 100644 --- a/packages/text-editor/src/Completion.ts +++ b/packages/text-editor/src/Completion.ts @@ -49,6 +49,7 @@ export const Completion = Node.create({ .run() }, allow: ({ editor, range }) => { + if (range.from > editor.state.doc.content.size) return false const $from = editor.state.doc.resolve(range.from) const type = editor.schema.nodes[this.name] // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions