fix: add missing files binding (#9415)

no two-way binding because setting it involves a `DataTransfer` workaround, so it's not really officially supported that way - if you need that, you shouldn't use that binding probably. This matches the behavior in Svelte 4.

Co-authored-by: Rich Harris <rich.harris@vercel.com>
pull/9438/head
Simon H 2 years ago committed by GitHub
parent 9aa06bdf9e
commit 7ab03ae36c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: add missing files binding

@ -325,6 +325,10 @@ export const validation = {
if (node.name === 'checked' && type?.value[0].data !== 'checkbox') {
error(node, 'invalid-binding', node.name, '<input type="checkbox">');
}
if (node.name === 'files' && type?.value[0].data !== 'file') {
error(node, 'invalid-binding', node.name, '<input type="file">');
}
}
if (parent.name === 'select') {

@ -179,5 +179,10 @@ export const binding_properties = {
},
value: {
valid_elements: ['input', 'textarea', 'select']
},
files: {
event: 'change',
valid_elements: ['input'],
omit_in_ssr: true
}
};

Loading…
Cancel
Save