How come the @change
event triggers in a v-text-field
when I press enter, even if I haven't made any changes?
HTML
<div id="app">
<v-app>
<v-content>
<v-container>
<v-text-field
@change="onChange"
slot="input"
label="Edit"
v-model="test"
single-line
></v-text-field>
</v-container>
</v-content>
</v-app>
</div>
JS
new Vue({
el: '#app',
data: () => ({
test: 'test'
//
}),
methods: {
onChange () {
console.log('changed')
}
}
})
For instance, if I hit enter without modifying anything, the onChange event should not log "changed" because the input remains the same ('test' in this case).
You can view this example in this pen: https://codepen.io/jdash99/pen/aaEYLB?editors=1111