Skip to content
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

fix: Hard break keyboard shortcut not working in custom blocks #1554

Merged
merged 5 commits into from
Mar 27, 2025

Conversation

matthewlipski
Copy link
Collaborator

@matthewlipski matthewlipski commented Mar 21, 2025

closes #1554

Copy link

vercel bot commented Mar 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Mar 27, 2025 2:25pm
blocknote-website ✅ Ready (Inspect) Visit Preview Mar 27, 2025 2:25pm

Copy link
Collaborator

@YousefED YousefED left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice - if possible; can we do this without the commands interface of Tiptap? (would rather use more vanilla PM code.

Also, why do we need the priority exactly?

@@ -179,7 +179,7 @@ const getTipTapExtensions = <
types: ["blockContainer", "columnList", "column"],
setIdAttribute: opts.setIdAttribute,
}),
HardBreak.extend({ priority: 10 }),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Priority makes sense, since it needs to be higher priority

@YousefED
Copy link
Collaborator

@nperez0111 @matthewlipski let's maybe also think through whether this should be configurable or not.

  • Do we want to make it easy to make custom blocks where shift+enter doesn't insert a break? (do we see use cases for this)?
  • Do we want to make it easy to make custom blocks where just enter inserts a break? (do we see use cases for this)?

@nperez0111
Copy link
Contributor

True, yea let's discuss what we want here,

I've seen a lot of stuff lately around custom blocks & newline behaviour:

@matthewlipski
Copy link
Collaborator Author

I added a proposal for configuring the hard break shortcut behaviour in the most recent commit. Lmk if it seems ok!

Copy link
Collaborator

@YousefED YousefED left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks nice imo!

@YousefED
Copy link
Collaborator

@matthewlipski can you add docs for this + comment the BlockConfig in the code? (let's make this standard practice)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants