Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[2.2.3] Clear if value is zero feature is broken #42

Closed
ankurk91 opened this issue Oct 26, 2017 · 1 comment
Closed

[2.2.3] Clear if value is zero feature is broken #42

ankurk91 opened this issue Oct 26, 2017 · 1 comment

Comments

@ankurk91
Copy link

ankurk91 commented Oct 26, 2017

Hi,

Expected Behavior

If v-model value is 0.00 then input field should clear on focus

Actual Behavior

Input remains same

Steps to Reproduce the Problem

http://jsfiddle.net/cvg6c4r3/6/

I have also tried adding a directive but no luck

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.number="money"></vue-numeric>

Specifications

  • Plugin Version: 2.2.3+
  • Vue.js Version: 2.5.2/2.4.4
  • Browser: chrome 62 beta
  • OS: macOs sierra

Ref #26

@ankurk91 ankurk91 changed the title [2.2.5] Clear if value is zero feature is broken [2.2.3] Clear if value is zero feature is broken Oct 26, 2017
@kevinongko
Copy link
Owner

Hi @ankurk91,

Sorry for the returning issue. Should be fixed in v2.2.6

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants