Vue render option tag with empty value attribute without attribute
Vue version
3.4.20
Link to minimal reproduction
Steps to reproduce
- Create select tag
- Create
<option value=""></option>
What is expected?
<select>
<option value=""></option>
</select>
What is actually happening?
<select>
<option></option>
</select>
System Info
System:
OS: Linux 5.15 Linux Mint 21.2 (Victoria)
CPU: (12) x64 AMD Ryzen 5 5600G with Radeon Graphics
Memory: 11.49 GB / 30.64 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 21.4.0 - ~/.nvm/versions/node/v21.4.0/bin/node
Yarn: 1.22.21 - ~/.nvm/versions/node/v21.4.0/bin/yarn
npm: 10.4.0 - ~/.nvm/versions/node/v21.4.0/bin/npm
pnpm: 8.15.4 - ~/.nvm/versions/node/v21.4.0/bin/pnpm
bun: 1.0.26 - ~/.nvm/versions/node/v21.4.0/bin/bun
Browsers:
Chrome: 121.0.6167.184
npmPackages:
vue: ^3.4.20 => 3.4.20
Any additional comments?
No response
While I understand that it is an unexpected result, I'm curious how this issue breaks your apps/libraries in real-world usage?
While I understand that it is an unexpected result, I'm curious how this issue breaks your apps/libraries in real-world usage?
Hi. An error occurs when working with the backend, which is written in more type-sensitive languages like GO and php8, in my case. For example, I have an automatic typecast get params (id of database entity), which expect int or null, but now i receive:
http://example.com?enitityId="Select a value"
In my app it should throw an error - Expect nullable int, received string
.
While I understand that it is an unexpected result, I'm curious how this issue breaks your apps/libraries in real-world usage?
https://github.com/jarstone/dselect/blob/main/source/js/dselect.js For example. The error occurs on line 122.
function isPlaceholder(option) {
return option.getAttribute('value') === ''
}