Skip to content

Commit 360d5d1

Browse files
committed
feat: Make editorprops public
1 parent 82b69ea commit 360d5d1

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

packages/core/src/editor/BlockNoteEditor.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,20 @@ export interface BlockNoteEditorOptions<
120120
*/
121121
domAttributes?: Partial<BlockNoteDOMAttributes>;
122122

123+
/**
124+
* Additional ProseMirror editor props to pass to the underlying editor view.
125+
* Use this to configure options such as `scrollMargin`, `scrollThreshold`,
126+
* `handleDOMEvents`, and other
127+
* [ProseMirror EditorProps](https://prosemirror.net/docs/ref/#view.EditorProps).
128+
*
129+
* Note: `attributes` (use {@link domAttributes} instead) and `transformPasted`
130+
* are managed by BlockNote and cannot be overridden here.
131+
*/
132+
editorProps?: Omit<
133+
NonNullable<EditorOptions["editorProps"]>,
134+
"attributes" | "transformPasted"
135+
>;
136+
123137
/**
124138
* Options for configuring the drop cursor behavior when dragging and dropping blocks.
125139
* Allows customization of cursor appearance and drop position computation through hooks.
@@ -520,6 +534,7 @@ export class BlockNoteEditor<
520534
extensions: tiptapExtensions,
521535
editorProps: {
522536
...newOptions._tiptapOptions?.editorProps,
537+
...newOptions.editorProps,
523538
attributes: {
524539
// As of TipTap v2.5.0 the tabIndex is removed when the editor is not
525540
// editable, so you can't focus it. We want to revert this as we have

0 commit comments

Comments
 (0)