Skip to content

Commit 82b69ea

Browse files
committed
fix(core): call scrollIntoView() on Enter
updates the enter handler to scrollintoview both globally and for listItems. Signed-off-by: Wqrld <wereld03@gmail.com>
1 parent 9cbf2ad commit 82b69ea

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

packages/core/src/blocks/utils/listItemEnterHandler.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ export const handleEnter = (
3434
} else if (blockContent.node.childCount > 0) {
3535
return editor.transact((tr) => {
3636
tr.deleteSelection();
37-
return splitBlockTr(tr, tr.selection.from, true);
37+
const result = splitBlockTr(tr, tr.selection.from, true);
38+
tr.scrollIntoView();
39+
return result;
3840
});
3941
}
4042

packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,7 @@ export const KeyboardShortcutsExtension = Extension.create<{
922922
selectionAtBlockStart,
923923
),
924924
)
925+
.scrollIntoView()
925926
.run();
926927

927928
return true;

0 commit comments

Comments
 (0)