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

Input value attribute gets set to "undefined" #4871

Closed
fatmirsukaliq opened this issue May 20, 2020 · 2 comments
Closed

Input value attribute gets set to "undefined" #4871

fatmirsukaliq opened this issue May 20, 2020 · 2 comments

Comments

@fatmirsukaliq
Copy link

Describe the bug
When value on form elements not provided, it renders <input type="radio" value="undefined"/>, instead of just not rendering the value attribute at all.

To Reproduce
https://svelte.dev/repl/c06ad00f7e08410c813f7adbb746734a?version=3.22.3

Expected behavior
I expected this to be rendered: <input type="radio" />

Severity
Medium

@antony
Copy link
Member

antony commented May 21, 2020

Use null to render an empty value attribute. An undefined variable will be seen as a value of undefined across all input fields.

https://svelte.dev/repl/88d8046cc4ac4fd3b8789020d66ced7e?version=3.22.3

@antony antony closed this as completed May 21, 2020
@fatmirsukaliq
Copy link
Author

@antony thanks on your response, but curious why is bind:value getting different treatment:

#4849 (comment)

this was already merged into master

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

No branches or pull requests

2 participants