Subscribe on changes!

Unexpected behavior on Input event

avatar
Nov 10th 2021

Version

3.2.21

Reproduction link

sfc.vuejs.org/

Steps to reproduce

if you type a number greater than 45 in this example, it lets you keep typing after the condition is met once. after the condition is met once it basically ignores the value prop in MyInput.

What is expected?

expected to repeatedly get the same value (45) when the input value is greater than 45.

What is actually happening?

start typing numbers, when the condition is met and the value changes to 45 keep typing to see it being ignored.

it emits the correct event and the value ref is correct but it will get ignored.


I was applying a simple v-model and noticed the value doesnt apply even when the ref changed to the correct number and the event emitted the correct value.

avatar
Nov 10th 2021

This is intended behavior because the value on the parent doesn't change from 45 so the child doesn't update again. You need to force the value on the input to constrain it.

avatar
Nov 10th 2021

thank you for the quick response!