Skip to content

Instantly share code, notes, and snippets.

@dahnielson
Last active August 2, 2020 08:49
Show Gist options
  • Save dahnielson/59566b3d91cc8cf09c13d1419604a8a2 to your computer and use it in GitHub Desktop.
Save dahnielson/59566b3d91cc8cf09c13d1419604a8a2 to your computer and use it in GitHub Desktop.
Open the file dialog in Svelte
<script>
let fileInput
</script>
<style>
input {
display: none;
}
</style>
<input type="file" bind:this={fileInput} />
<button on:click={fileInput.click()}>Open File...</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment