beforeUpdate vModelRadio not setting checked on a radio input that has been reset, the created works as expected
Vue version
3.3.4
Link to minimal reproduction
Steps to reproduce
Set a value via v-model on the input, then reset on form. Then try to set the value again on the input's v-model. The radio button gets checked fine on initial page load, but it does not work after getting reset.
What is expected?
The radio input should have prop checked set to true.
What is actually happening?
Nothing.
System Info
No response
Any additional comments?
It looks to me, like the beforeUdpate condition in vModelRadio needs to have an additional else-if to check if nothing is checked off, but the value matches the v-model value, then set checked prop to true so that the radio button is visibly checked off. I have confirmed the v-model variable has been updated to the expected value that should match the input value.
In my use case I have a form for editing customers, it works on initial page load. Then after resetting it and assigning new customer data to it, it no longer works. The rest of the fields work as expected (selects, inputs etc.)
I posted on discord, but didn't get much of a response, so I thought it was time to report it. Thanks!! :)
<form>
<div>
<label for="example">Type in some sample text</label>
<input id="example" type="text" value="123" />
</div>
<div>
<label for="radio">radio</label>
<input id="radio" type="radio" name="radio" value="radio" checked onchange="changeRadio(event)" />
<label for="radio1">radio1</label>
<input id="radio1" type="radio" name="radio" value="radio1" onchange="changeRadio(event)" />
</div>
<div>
<input type="reset" value="Reset the form" />
</div>
</form>
function changeRadio(e){
console.log(e)
}
form.reset()
will not trigger the onchange event of radio