2.4.2
https://jsfiddle.net/50wL7mdz/50808/
Simply create a number input and use the up and down arrow keys on it in Microsoft Edge browser. v-model will not update the bidirectional value.
The value on the Vue component/instance would be updated by the up/down arrow keys as it is in Chrome and Firefox.
The value is not updated.
This is likely an issue of MS Edge itself, and has nothing to do with vue.
Remove vue dependency, and you will get same behavior in Edge:
https://jsfiddle.net/jingkaizhao/50wL7mdz/50822/
Thanks, I can confirm your vue-less fiddle works in Firefox/Chrome but not Edge.
Closing then 馃檪
Awesome, also it seems like this is already filed as a bug on Edge, didn't find it earlier because it was a little hard to search for.
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10242461/
Cool beans!
For further reference, a similar issue remains open on the AngularJS tracker as well:
https://github.com/angular/angular.js/issues/15366
Possible workaround until this is fixed in Edge:
<template>
<input @input="updateValue" @keyup="updateValueInEdge">
</template>
<script>
export default {
name: 'FormInput',
props: {
value: {
type: [String, Number],
},
},
methods: {
updateValueInEdge(e) {
// Edge does not trigger the input event if arrow keys are used to change the value.
// The key codes `Up` and `Down` are only used by Microsoft browsers (others use `ArrowUp` and `ArrowDown`).
if (e.key === 'Up' || e.key === 'Down') {
this.updateValue(e);
}
},
updateValue(e) {
this.$emit('input', e.target.value);
},
},
};
</script>
Another workaround would be vue-autonumeric: https://www.npmjs.com/package/vue-autonumeric
Most helpful comment
Possible workaround until this is fixed in Edge: