Fix input with bind:value displaying "undefined"

There's a bug where when `<input bind:value={sampleVar} />` and `sampleVar` is updated to undefined (`sampleVar = undefined`), then the input displays "undefined" (despite the input initally showing up correctly empty when initialized to undefined).

This issue has been documented since September 14, 2019 https://github.com/sveltejs/svelte/issues/3569

I'm new to Svelte, but this seems to fix this problem.
pull/4849/head
Jeremy Bernier 5 years ago committed by GitHub
parent a1b0295fc3
commit d8fb0bb62c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -193,7 +193,7 @@ export function set_data(text, data) {
export function set_input_value(input, value) { export function set_input_value(input, value) {
if (value != null || input.value) { if (value != null || input.value) {
input.value = value; input.value = value || '';
} }
} }

Loading…
Cancel
Save