QInput @change event doesn't work
Software version
Quasar: 0.15.10 OS: Node: NPM: Browsers: iOS: Android: Any other software related to your bug:
JsFiddle (for Quasar v0.15+ only)
https://jsfiddle.net/2skym112/
What did you get as the error?
QInput does not emit @change events - please see the example code above
What were you expecting?
What steps did you take, to get the error?
Explanation on proper usage: https://github.com/quasarframework/quasar/issues/1803#issuecomment-374334078
I don't see how this explanation is related to the issue. The problem that the @change event is NOT being envoked at all, doesn't matter whatever function we define there.
Have you seen my fiddle example?
You're using v-model. This is equivalent to :value="model" @input="(newVal) => model = newVal".
So, as a result, @change does not gets called, since @input is emitted first, changes the model, then Quasar components emits @change only if model is different than the value being emitted... and since @input from v-model already updated the model, the value is same as the one emitted, so the @change event is skipped.
Either use:
- v-model along with
@input - The "lazy" equivalent of v-model (
:value="model" @change="(newVal) => { model = newVal; callSomething...() }")
dont forget to change 'v-model' props into ':value'. https://jsfiddle.net/2nfkes79/