refac/enh: file upload with paste

This commit is contained in:
Timothy Jaeryang Baek
2025-07-16 15:01:03 +04:00
parent 20b6892d9b
commit 8807ac8cac
2 changed files with 19 additions and 1 deletions
@@ -1077,7 +1077,10 @@
const hasImageItem = Array.from(event.clipboardData.items).some((item) =>
item.type.startsWith('image/')
);
if (hasImageFile || hasImageItem) {
const hasFile = Array.from(event.clipboardData.files).length > 0;
if (hasImageFile || hasImageItem || hasFile) {
eventDispatch('paste', { event });
event.preventDefault();
return true;