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;
}
};
}
});
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.
Current behavior Expected behavior (with directive)