Skip to content

Conversation

matthewlipski
Copy link
Collaborator

@matthewlipski matthewlipski commented Nov 12, 2024

Closes #1237

Currently, getNearestBlockContainerPos gets the nearest block, which may be a columnList, column, or blockContainer. I think the functionality is fine, but this PR renames it to getNearestBlockPos for better clarity and removes the error in getBlockInfoFromSelection for when something other than a blockContainer is returned. This fixes a bug that caused said error to be thrown by selecting a column node using triple click (I think) or Cmd+click.

Copy link

vercel bot commented Nov 12, 2024

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

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Nov 13, 2024 5:03pm
blocknote-website ✅ Ready (Inspect) Visit Preview Nov 13, 2024 5:03pm

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.

nice fix! What's the part that actually fixes the clicking?

@matthewlipski
Copy link
Collaborator Author

nice fix! What's the part that actually fixes the clicking?

Removing the error throw from getBlockInfoFromSelection - it was getting triggered in double/triple clicking the resize bar as that would select the column, and then the formatting toolbar buttons would try to render. They pretty much all use getBlockInfoFromSelection somewhere, and so the error would be thrown. Basically all the changes are to accommodate for the fact that we no longer throw this error.

@matthewlipski matthewlipski merged commit 8200117 into main Nov 14, 2024
4 checks passed
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.

double clicking block resizer crashes

2 participants