Skip to content

Commit

Permalink
fix: initialize files bind on hydration
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloricciuti committed Jan 19, 2025
1 parent 700029b commit a65d463
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/happy-ants-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: initialize `files` bind on hydration
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,15 @@ export function bind_files(input, get, set = get) {
set(input.files);
});

if (
// If we are hydrating and the value has since changed,
// then use the updated value from the input instead.
hydrating &&
input.files
) {
set(input.files);
}

render_effect(() => {
input.files = get();
});
Expand Down

0 comments on commit a65d463

Please sign in to comment.