From 302ffc8b7ebee1ccec9d883646b1ff4ed8ee137a Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Sat, 22 Aug 2026 08:12:40 -0400 Subject: [PATCH] fix: skip the autocompletion debounce when the document shrank past the captured position (#28824) --- src/lib/components/common/RichTextInput/AutoCompletion.js | 1 + 1 file changed, 1 insertion(+) 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