-
-
Notifications
You must be signed in to change notification settings - Fork 742
fix(core): call scrollIntoView() on Enter #2802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" | ||
| >; | ||
|
Comment on lines
+123
to
+135
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure that I want to expose this @Wqrld, can you explain what you would be using this for? If it is just for scrollMargin, I think we could set that default within BlockNote instead of having to expose this whole config on our API surface for it.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is indeed just for scrollmargin and scrollthreshold. Any way that exposes those in some way or another works for me.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What values are you using for those? I don't think I would expose that low-level of a concept. I would just pick a value that makes sense for BlockNote already
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was playing around with 72 for scrollmargin and 0 for scrollThreshold. What feels right depends a bit on the font and editor size so i prefer to make it configurable (with good defaults) |
||
|
|
||
| /** | ||
| * Options for configuring the drop cursor behavior when dragging and dropping blocks. | ||
| * Allows customization of cursor appearance and drop position computation through hooks. | ||
|
|
@@ -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 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.