jonathanpmartins / v-money3

Vue3 currency input/directive mask
MIT License
103 stars 27 forks source link

First digit is considered as integer #43

Closed sougiovn closed 3 years ago

sougiovn commented 3 years ago

The usual behavior of the lib is that every digit inputted, it compound the value from the smallest decimal case and keeps bumping the previous numbers into the bigger cases.

But the last released version seems to have a bug.

Every first digit in my input consider the first digit as the first integer digit and the following inputs follow the normal behavior of compounding the value from the smallest case and bumping the previous numbers.

I noticed it in the latest version: 3.17.4

I'm using the component with v-model.number. Configuration:

{
  decimal: ',',
  thousands: '.',
  prefix: 'R$ ',
  suffix: '',
  precision: 2,
  masked: false,
  disableNegative: false,
  disabled: false,
  min: Number.MIN_SAFE_INTEGER,
  max: Number.MAX_SAFE_INTEGER,
  allowBlank: false,
  minimumNumberOfCharacters: 0
}

Here follows a gif of me tabbing into the component and only pressing 1. v-money3bug

jonathanpmartins commented 3 years ago

New tests are done also with puppeteer. This insures that we have better control of what is happening at the browser level. This issue now has it's own tests. Thanks for reporting! Fixed on 3.17.5