-
-
Notifications
You must be signed in to change notification settings - Fork 671
fix: ignore drag & drop from unrelated events #1968 #2346
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?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
|
@nperez0111 Hey Nick, sadly the fix is not fully working yet. The issue is that The fix needs to also check for external drags at the start of onDragOver = (event: DragEvent) => {
if ((event as any).synthetic) {
return;
}
// Add this check to prevent interference with external DnD
if (!event.dataTransfer?.types.includes("blocknote/html")) {
return;
}
const context = this.getDragEventContext(event);
// ...
}Maybe you have to add more checks. Thanks a lot! |
|
@roNn23 thanks for trying it out, I've just gone ahead & added the same check in the other handlers just to be sure. I think this should work better now. If not, I'll have to look into the pragmatic-drag-and-drop implementation to see what is conflicting exactly, which will take some time |
Summary
This implements a fix for #1968 to ignore drag & drop events for completely unrelated events on the page.
I tested with this:
Rationale
If an event is not from the current blocknote editor, or coming from another blocknote editor on the page, we should not be capturing that event.
Changes
Impact
It could have impact on drag & drop behavior, manual testing was done to make sure blocknote drag & drop worked as expected.
Testing
Manual testing, given the complexity of adding e2e tests for drag & drop behaviors
Screenshots/Video
Checklist
Additional Notes
Thanks to @roNn23 for pointing out this fix