adjustments

pull/5141/head
Conduitry 5 years ago
parent aa616cba9b
commit 13e4b801e9

@ -544,11 +544,9 @@ Numeric input values are coerced; even though `input.value` is a string as far a
<input type="range" bind:value={num}>
```
##### File input bindings
---
On `<input>` elements with `type="file"`, you can use `bind:files` to get the [list of selected files](https://developer.mozilla.org/en-US/docs/Web/API/FileList).
On `<input>` elements with `type="file"`, you can use `bind:files` to get the [`FileList` of selected files](https://developer.mozilla.org/en-US/docs/Web/API/FileList).
```sv
<label for="avatar">Upload a picture:</label>

@ -2,6 +2,8 @@
let files;
$: if (files) {
// Note that `files` is of type `FileList`, not an Array:
// https://developer.mozilla.org/en-US/docs/Web/API/FileList
console.log(files);
for (const file of files) {
@ -33,8 +35,3 @@
<p>{file.name} ({file.size} bytes) </p>
{/each}
{/if}
<!--
Note that `files` is of type `FileList`, not an Array:
https://developer.mozilla.org/en-US/docs/Web/API/FileList
-->
Loading…
Cancel
Save