fix(drag-n-drop): support PDF block drag & drop (BLO-893)#2714
fix(drag-n-drop): support PDF block drag & drop (BLO-893)#2714nperez0111 merged 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe PR fixes PDF block drag-and-drop functionality by broadening the drag image cleanup logic in SideMenu/dragging.ts to remove all embedded documents (iframes, embeds, objects) instead of just iframes. End-to-end tests verify the fix with PDF block drag scenarios and snapshots. ChangesPDF Drag-and-Drop Fix
Suggested reviewers
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@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
left a comment
There was a problem hiding this comment.
Good catch @matthewlipski
Summary
In the PDF block example, dragging and dropping the PDF block using the drag handle is currently broken. This is because like
iframeelements,embedelements are also subject to CORS policies, which cause issues when trying to set the drag preview.Currently, we only account for
iframeelements though, and as the PDF block uses anembedelement, attempting to set the drag preview causes the whole drag to fail.This PR fixes that by omitting
embedandobjectelements from the drag prevew as well asiframeelements.Closes #1205
Rationale
This issue affects not only PDF blocks, but any custom blocks using the aforementioned element types.
Changes
See above.
Impact
N/A
Testing
Added e2e test.
Screenshots/Video
N/A
Checklist
Additional Notes
N/A
Summary by CodeRabbit
Bug Fixes
Tests