From 1d47f6cc8be84ab368ad91f287909ee162d1f2e2 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Wed, 27 Mar 2024 15:42:12 -0400
Subject: fixed toggling footnotes.  fixed error in bullet hit test.  fixed
 problems with backspace and enter in prosemirror transfer.  fixed display of
 markdown options to start at top.

---
 src/client/views/nodes/formattedText/FormattedTextBox.tsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src/client/views/nodes/formattedText/FormattedTextBox.tsx')

diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index 729c4d534..9882a9be9 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -1685,7 +1685,8 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FormattedTextB
                     $olistPos = this._editorView?.state.doc.resolve(($olistPos as any).path[($olistPos as any).path.length - 4]);
                 }
             }
-            const listPos = this._editorView?.state.doc.resolve(clickPosVal === olistPos ? clickPosVal + 1 : clickPosVal);
+            const maxSize = this._editorView?.state.doc.content.size ?? 0;
+            const listPos = this._editorView?.state.doc.resolve(Math.min(maxSize, clickPosVal === olistPos ? clickPosVal + 1 : clickPosVal));
             const listNode = listPos?.node();
             if (olistNode && olistNode.type === this._editorView?.state.schema.nodes.ordered_list && listNode) {
                 if (!highlightOnly) {
-- 
cgit v1.2.3-70-g09d2

