Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/core/src/blocks/utils/listItemEnterHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
}

Expand Down
15 changes: 15 additions & 0 deletions packages/core/src/editor/BlockNoteEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ export interface BlockNoteEditorOptions<
*/
domAttributes?: Partial<BlockNoteDOMAttributes>;

/**
* 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<EditorOptions["editorProps"]>,
"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.
Expand Down Expand Up @@ -520,6 +534,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,7 @@ export const KeyboardShortcutsExtension = Extension.create<{
selectionAtBlockStart,
),
)
.scrollIntoView()
.run();

return true;
Expand Down
Loading