Merge pull request #2860 from elliotwaite/master

Fix CRUD example to allow changing input values.
pull/2876/head
Rich Harris 6 years ago committed by GitHub
commit 4d003f1b0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -30,10 +30,7 @@
$: selected = filteredPeople[i];
$: {
first = selected ? selected.first : '';
last = selected ? selected.last : '';
}
$: reset_inputs(selected);
function create() {
people = people.concat({ first, last });
@ -53,7 +50,8 @@
}
function reset_inputs(person) {
({ first, last } = person);
first = person ? person.first : '';
last = person ? person.last : '';
}
</script>

Loading…
Cancel
Save