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

Value is not rendered when using <select> with nullable options #4208

Closed
Livijn opened this issue Jul 28, 2021 · 2 comments
Closed

Value is not rendered when using <select> with nullable options #4208

Livijn opened this issue Jul 28, 2021 · 2 comments

Comments

@Livijn
Copy link

Livijn commented Jul 28, 2021

Version

3.1.5

Reproduction link

https://codepen.io/Livijn/pen/GRmxgMb

Steps to reproduce

Create a <select> with an <option :value="null"> and check the rendered HTML.

What is expected?

The :value="null" should be rendered as :value="" so the form works when sending it with GET option.

What is actually happening?

When submitting the form when the nullable option is selected, the value of the select element will be the text of the option since no value is rendered. I think this was caused by #3564

@posva
Copy link
Member

posva commented Jul 28, 2021

having value="" rendered with :value="null" was a bug. You can still pass value="" yourself and initialize the selected to "" Example

@posva posva closed this as completed Jul 28, 2021
@Justineo
Copy link
Member

#3564 is an intentional change to align the behavior with this RFC.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants