Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix input with bind:value displaying "undefined" #4849

Merged
merged 1 commit into from
May 17, 2020

Conversation

JeremyBernier
Copy link
Contributor

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 #3569

I'm new to Svelte, but this seems to fix this problem.

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 sveltejs#3569

I'm new to Svelte, but this seems to fix this problem.
@Rich-Harris Rich-Harris merged commit d8fb0bb into sveltejs:master May 17, 2020
@Rich-Harris
Copy link
Member

Thanks! This didn't handle the case where a value is set to 0, so I changed that and added a test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants