Skip to content

Commit

Permalink
feat: allow images to be uploaded from the clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
iOvergaard committed Oct 16, 2024
1 parent 4c1c309 commit 36ee565
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/packages/tiptap/extensions/core/media-upload.extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ export default class UmbTiptapMediaUploadExtensionApi extends UmbTiptapExtension

self.#uploadTemporaryFile(files, this.editor);
});

host.addEventListener('paste', (event) => {
const files = event.clipboardData?.files;
if (!files) return;

self.#uploadTemporaryFile(files, this.editor);
});
},
}),
];
Expand Down

0 comments on commit 36ee565

Please sign in to comment.