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

Unexpected autoDecimalDigits behavior in component Playground #389

Open
nsmith0011 opened this issue May 19, 2023 · 1 comment
Open

Unexpected autoDecimalDigits behavior in component Playground #389

nsmith0011 opened this issue May 19, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@nsmith0011
Copy link

nsmith0011 commented May 19, 2023

Vue Currency Input version

v3.04

Vue version

v3

What browser are you using?

Firefox version 113

What operating system are you using?

Windows 10

Reproduction link

https://dm4t2.github.io/vue-currency-input/playground.html

Describe your issue

NOTE: I work in software development but I'm not a developer. This is the first "bug" (if that's what it is) I've reported on GitHub, so I hope I'm not breaking any etiquette or rules that I'm not aware of. Please be kind to me.

I did search the known issues first but didn't find this "bug" reported anywhere.

From a user POV it is expected that entering "99", ".99" or "0.99" would all result in "0.99" with the auto decimal digits function turned on. Entering "99", ".99" or "0.99" and seeing "99.00" would be unexpected by most users in my experience and seems like an anomaly/bug.

I'm seeing this unexpected behavior on the Playground but not in CodeSandbox.

To reproduce:

  1. Go to Playground: https://dm4t2.github.io/vue-currency-input/playground.html
  2. Turn on Auto Decimal Digits
  3. Enter ".99" into the input field. Expected to see ".99" or "0.99" in field, instead see "99.00".

Compare to CodeSandbox:

  1. Go to Examples: https://dm4t2.github.io/vue-currency-input/examples.html
  2. Click on Element Plus button which will take you to CodeSandbox
  3. Click on App.vue if not already selected
  4. Change line 9 from <ElCurrencyInput v-model="value" :options="{ currency: 'EUR' }" /> to <ElCurrencyInput v-model="value" :options="{ currency: 'EUR', autoDecimalDigits: true }" />
  5. Save
  6. Refresh browser previewer
  7. Enter ".99" into the input field. See "0.99" in field, as one would expect.

Regardless of whether the behavior is intended or not, it is inconsistent between the Playground and CodeSandbox. This may be explainable but I was unable to figure out the cause given my limited developer knowledge.

@dm4t2
Copy link
Owner

dm4t2 commented May 20, 2023

Good catch 👍
The input of the decimal separator (".") should be ignored in this case.

@dm4t2 dm4t2 added the bug Something isn't working label May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants