Skip to content

Commit

Permalink
Merge pull request #23 from adityaoberai/feat-past-image
Browse files Browse the repository at this point in the history
Add copy paste image support
  • Loading branch information
adityaoberai authored Oct 13, 2023
2 parents b040909 + d677623 commit 0ddd9eb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/AltText.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ function resetScreen()
altText = 'Alt text will load here shortly...';
}
window.addEventListener("paste", async(e) => {
var imageInput = document.querySelector('#imageInput');
imageInput.files = e.clipboardData.files;
await generateAltText();
});
</script>

<input type="file" id="imageInput" accept="image/*" on:input={generateAltText}>
Expand Down

1 comment on commit 0ddd9eb

@vercel
Copy link

@vercel vercel bot commented on 0ddd9eb Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.