Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

New input displays formatted value if focused too quickly #68

Open
mgasparel opened this issue May 7, 2018 · 0 comments
Open

New input displays formatted value if focused too quickly #68

mgasparel opened this issue May 7, 2018 · 0 comments

Comments

@mgasparel
Copy link

If you set the focus on a new vue-numeric input immediately after creating it, the input does not stay cleared, and will display the formatted value after a brief moment, as if it has lost focus.

I can see that in the mounted() event, we're updating the value, then updating it again 500ms later. I don't want to attempt to fix this without understanding what the purpose of this delay is:

      // In case of delayed props value.
      setTimeout(() => {
        this.process(this.valueNumber)
        this.amount = this.format(this.valueNumber)
      }, 500)

Expected Behavior

A new vue-numeric input, when focused immediately after being created, should remain focused and should remain cleared until the first blur event

Actual Behavior

If the new input is focused too quickly, the formatted value is displayed instead of remaining blank

Steps to Reproduce the Problem

  1. Create a new instance of vue-numeric
  2. Immediately set focus to the new input.
  3. Input correctly receives focus and contains no value
  4. Half a second later, the input sets it's value to $0.00 and retains focus

Specifications

  • Plugin Version: 2.3.0
  • Vue.js Version: 2.5.16
  • Browser: Chrome
  • OS: Windows 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant