Subscribe on changes!

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

avatar
Jul 28th 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

avatar
Jul 28th 2021

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

avatar
Jul 28th 2021

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