Skip to content

fix: External file drag/drop and copy/paste#1052

Merged
matthewlipski merged 2 commits into
mainfrom
external-file-drop-fixes
Sep 6, 2024
Merged

fix: External file drag/drop and copy/paste#1052
matthewlipski merged 2 commits into
mainfrom
external-file-drop-fixes

Conversation

@matthewlipski
Copy link
Copy Markdown
Collaborator

This PR fixes 2 issues with dropping and pasting external files into the editor.

First, the files are now always inserted as new blocks instead of updating existing ones, and also dropping has been fixed to use the block under the mouse cursor instead of the currently selected one.

Second, using file extensions in a file block's fileBlockAcceptMimeTypes was throwing errors before, and is now fixed. File extensions and MIME types are now checked independently, whereas before, file extensions were just treated as MIME types causing some logic to fail.

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 6, 2024

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

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Sep 6, 2024 1:16pm
blocknote-website ✅ Ready (Inspect) Visit Preview Sep 6, 2024 1:16pm

Copy link
Copy Markdown
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, some minor suggestions

Comment thread packages/core/src/api/parsers/handleFileInsertion.ts
Comment thread packages/core/src/api/parsers/handleFileInsertion.ts Outdated
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.

2 participants