TypeCellOS / BlockNote

A React Rich Text Editor that's block-based (Notion style) and extensible. Built on top of Prosemirror and Tiptap.
https://www.blocknotejs.org/
Mozilla Public License 2.0
5.9k stars 384 forks source link

fix(side-menu): fix edge case when hovering group instead of a block #809

Closed clementprevot closed 4 weeks ago

clementprevot commented 4 weeks ago

This typically can happen when you add display: flex to .bn-block-group with a gap.
You can then happen to hover the group itself instead of a block or outer block element

When this happens, the id that would be given to editor.getBlock would be null, making it fail (by the way, adding an optional chaining operator or checking for null/undefined here may be a good idea, let me know if you want me to make a PR for that).

vercel[bot] commented 4 weeks ago

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

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Jun 5, 2024 10:03am
vercel[bot] commented 4 weeks ago

@clementprevot is attempting to deploy a commit to the TypeCell Team on Vercel.

A member of the Team first needs to authorize it.

matthewlipski commented 4 weeks ago

Thanks for your submission! Your solution does indeed fix this issue, though after looking through the code I figured there was some more fundamental issues with it that should also be fixed along with this bug. I created a new PR with those changes, see #814 for that.