From 2090c27fcd52862844b828be2fdbefd890755f1e Mon Sep 17 00:00:00 2001 From: Wqrld Date: Sat, 30 May 2026 22:14:31 +0200 Subject: [PATCH 1/4] fix(core): call scrollIntoView() on Enter updates the enter handler to scrollintoview both globally and for listItems. Signed-off-by: Wqrld --- packages/core/src/blocks/utils/listItemEnterHandler.ts | 4 +++- .../KeyboardShortcuts/KeyboardShortcutsExtension.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/src/blocks/utils/listItemEnterHandler.ts b/packages/core/src/blocks/utils/listItemEnterHandler.ts index ceb383a611..edd470513f 100644 --- a/packages/core/src/blocks/utils/listItemEnterHandler.ts +++ b/packages/core/src/blocks/utils/listItemEnterHandler.ts @@ -34,7 +34,9 @@ export const handleEnter = ( } else if (blockContent.node.childCount > 0) { return editor.transact((tr) => { tr.deleteSelection(); - return splitBlockTr(tr, tr.selection.from, true); + const result = splitBlockTr(tr, tr.selection.from, true); + tr.scrollIntoView(); + return result; }); } diff --git a/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts b/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts index 4b8be0650b..85e3ab685a 100644 --- a/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +++ b/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts @@ -920,6 +920,7 @@ export const KeyboardShortcutsExtension = Extension.create<{ selectionAtBlockStart, ), ) + .scrollIntoView() .run(); return true; From 51ef692d9de2d7919055af97936e56ba8b1f781b Mon Sep 17 00:00:00 2001 From: Wqrld Date: Sun, 31 May 2026 11:02:33 +0200 Subject: [PATCH 2/4] feat: Make editorprops public --- packages/core/src/editor/BlockNoteEditor.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/core/src/editor/BlockNoteEditor.ts b/packages/core/src/editor/BlockNoteEditor.ts index 7ff00c83cf..c75543dcc5 100644 --- a/packages/core/src/editor/BlockNoteEditor.ts +++ b/packages/core/src/editor/BlockNoteEditor.ts @@ -113,6 +113,20 @@ export interface BlockNoteEditorOptions< */ domAttributes?: Partial; + /** + * Additional ProseMirror editor props to pass to the underlying editor view. + * Use this to configure options such as `scrollMargin`, `scrollThreshold`, + * `handleDOMEvents`, and other + * [ProseMirror EditorProps](https://prosemirror.net/docs/ref/#view.EditorProps). + * + * Note: `attributes` (use {@link domAttributes} instead) and `transformPasted` + * are managed by BlockNote and cannot be overridden here. + */ + editorProps?: Omit< + NonNullable, + "attributes" | "transformPasted" + >; + /** * Options for configuring the drop cursor behavior when dragging and dropping blocks. * Allows customization of cursor appearance and drop position computation through hooks. @@ -499,6 +513,7 @@ export class BlockNoteEditor< extensions: tiptapExtensions, editorProps: { ...newOptions._tiptapOptions?.editorProps, + ...newOptions.editorProps, attributes: { // As of TipTap v2.5.0 the tabIndex is removed when the editor is not // editable, so you can't focus it. We want to revert this as we have From d7914a1ac3a1117c8ee2e5e0586e4e93be40395a Mon Sep 17 00:00:00 2001 From: Luc H Date: Mon, 1 Jun 2026 15:56:16 +0200 Subject: [PATCH 3/4] cleanup scrollintoview call Co-authored-by: Nick Perez --- packages/core/src/blocks/utils/listItemEnterHandler.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/core/src/blocks/utils/listItemEnterHandler.ts b/packages/core/src/blocks/utils/listItemEnterHandler.ts index edd470513f..4eb91accc0 100644 --- a/packages/core/src/blocks/utils/listItemEnterHandler.ts +++ b/packages/core/src/blocks/utils/listItemEnterHandler.ts @@ -34,10 +34,9 @@ export const handleEnter = ( } else if (blockContent.node.childCount > 0) { return editor.transact((tr) => { tr.deleteSelection(); - const result = splitBlockTr(tr, tr.selection.from, true); tr.scrollIntoView(); - return result; - }); + return splitBlockTr(tr, tr.selection.from, true); +}); } return false; From f90692dda70fef051d22a14f85df81eccab63066 Mon Sep 17 00:00:00 2001 From: Nick the Sick Date: Fri, 17 Jul 2026 11:43:57 +0200 Subject: [PATCH 4/4] fix(core): set scrollMargin default instead of exposing editorProps Replace the public editorProps option with a hardcoded scrollMargin default (72px top/bottom), keeping the API surface minimal per reviewer feedback. --- packages/core/src/editor/BlockNoteEditor.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/packages/core/src/editor/BlockNoteEditor.ts b/packages/core/src/editor/BlockNoteEditor.ts index c75543dcc5..e23b7c714d 100644 --- a/packages/core/src/editor/BlockNoteEditor.ts +++ b/packages/core/src/editor/BlockNoteEditor.ts @@ -113,20 +113,6 @@ export interface BlockNoteEditorOptions< */ domAttributes?: Partial; - /** - * Additional ProseMirror editor props to pass to the underlying editor view. - * Use this to configure options such as `scrollMargin`, `scrollThreshold`, - * `handleDOMEvents`, and other - * [ProseMirror EditorProps](https://prosemirror.net/docs/ref/#view.EditorProps). - * - * Note: `attributes` (use {@link domAttributes} instead) and `transformPasted` - * are managed by BlockNote and cannot be overridden here. - */ - editorProps?: Omit< - NonNullable, - "attributes" | "transformPasted" - >; - /** * Options for configuring the drop cursor behavior when dragging and dropping blocks. * Allows customization of cursor appearance and drop position computation through hooks. @@ -512,8 +498,8 @@ export class BlockNoteEditor< autofocus: newOptions.autofocus ?? false, extensions: tiptapExtensions, editorProps: { + scrollMargin: { top: 72, bottom: 72, left: 0, right: 0 }, ...newOptions._tiptapOptions?.editorProps, - ...newOptions.editorProps, attributes: { // As of TipTap v2.5.0 the tabIndex is removed when the editor is not // editable, so you can't focus it. We want to revert this as we have