Closed
Description
Hi,
When current value is zero 0.00
and user focus on input, user has to remove this value by pressing backspace 4 times and then he can start typing new values.
It would be good if component can clear the input field automatically when value is zero.
I made a simple directive to achieve this.
Vue.directive('clear-zero', {
bind: function (el, binding, vnode) {
el.onfocus = function () {
if (parseFloat(el.value) === 0) {
console.log('Clear value');
el.value = null;
}
};
}
});
<vue-numeric v-clear-zero currency="$" :precision="2" v-model="amount ></vue-numeric>
Metadata
Metadata
Assignees
Labels
No labels