Skip to content

Commit 082950b

Browse files
fix: Clipboard insertion with multiple data types (#1224)
* Made reading files lower priority than reading text when inserting from clipboard * Added warning when `uploadFile` is not defined when inserting file
1 parent 6024360 commit 082950b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const acceptedMIMETypes = [
22
"vscode-editor-data",
33
"blocknote/html",
4-
"Files",
54
"text/html",
65
"text/plain",
6+
"Files",
77
] as const;

packages/core/src/api/clipboard/fromClipboard/handleFileInsertion.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export async function handleFileInsertion<
5050
S extends StyleSchema
5151
>(event: DragEvent | ClipboardEvent, editor: BlockNoteEditor<BSchema, I, S>) {
5252
if (!editor.uploadFile) {
53+
// eslint-disable-next-line no-console
54+
console.warn(
55+
"Attempted ot insert file, but uploadFile is not set in the BlockNote editor options"
56+
);
5357
return;
5458
}
5559

0 commit comments

Comments
 (0)