-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Closed
Labels
🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.has workaroundA workaround has been found to avoid the problemA workaround has been found to avoid the problem
Description
Vue version
3.5.10
Link to minimal reproduction
Steps to reproduce
Here's a simple reproduction:
<script setup>
import { ref } from 'vue'
const msg = ref('Hello World!')
</script>
<template>
<h1>{{ msg }} {{ msg === null }}</h1>
<select v-model="msg">
<option :value="null">Display Only</option>
<option value="a">A</option>
<option value="b">B</option>
<option value="c">C</option>
<option value="d">D</option>
</select>
</template>If you select the first option, then the msg variable gets the value "Display Only". Removing the D option and it gets the value null. This is similar to a previous bug I reported (#6568) but in this case it only seems to happen when using null as the value.
What is expected?
The value of the model should be null regardless of how many options I have.
What is actually happening?
Once you have 5 or more options, the value becomes the string in the HTML, not null.
System Info
No response
Any additional comments?
No response
Metadata
Metadata
Assignees
Labels
🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.has workaroundA workaround has been found to avoid the problemA workaround has been found to avoid the problem