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: Clipboard insertion with multiple data types #1224

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

matthewlipski
Copy link
Collaborator

Currently, when inserting content from the clipboard, we prioritize files over text. However, this is problematic in some cases, such as when copy/pasting Excel tables. In this scenario, the table is written to text/html and an image of the table is written to Files on the clipboard. So previously, an image block was created and in this PR, the table block is created instead.

There may be other cases in which we actually do want to prioritize files over text, but I'm not sure atm. This is not relevant for pasting/dropping files from the user's OS file system as in that case, data is only written to Files on the clipboard so the priority doesn't matter.

Copy link

vercel bot commented Nov 7, 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:25pm
blocknote-website ✅ Ready (Inspect) Visit Preview Nov 13, 2024 5:25pm

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! One additional request; can we log a warning to the console if the user tries to paste an image (File), but uploadFile is not implemented?

@matthewlipski matthewlipski merged commit 082950b 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.

2 participants