diff --git a/src/lib/components/common/RichTextInput/AutoCompletion.js b/src/lib/components/common/RichTextInput/AutoCompletion.js index cd6a3aa38e..d76a5ec021 100644 --- a/src/lib/components/common/RichTextInput/AutoCompletion.js +++ b/src/lib/components/common/RichTextInput/AutoCompletion.js @@ -86,6 +86,7 @@ export const AIAutocompletion = Extension.create({ const newState = view.state; const newSelection = newState.selection; + if (currentPos >= newState.doc.content.size) return false; const newNode = newState.doc.nodeAt(currentPos); // Check if the node still exists and is still a paragraph