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: React custom blocks not valid drop targets #1511

Merged
merged 2 commits into from
Mar 10, 2025

Conversation

matthewlipski
Copy link
Collaborator

Dropping dragged blocks inside a React custom block may fail to actually fire a drop event. It seems like this is because they aren't seen as valid drop targets, so this PR makes them valid drop targets by adding the dragover listener.

The easiest way to see this is with the alert block example. Try dragging a block from below it and dropping it on the alert type icon, so that the drop indicator is above the alert. The drop won't fire and the dragged block will return to its original position.

This doesn't seem to be necessary for vanilla JS custom blocks.

Copy link

vercel bot commented Mar 7, 2025

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

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Mar 7, 2025 3:43pm
blocknote-website ✅ Ready (Inspect) Visit Preview Mar 7, 2025 3:43pm

@matthewlipski matthewlipski merged commit 6064fa0 into main Mar 10, 2025
7 checks passed
@matthewlipski matthewlipski deleted the react-custom-block-drop-fix branch March 10, 2025 11:03
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.

1 participant