taiga-family/maskito

๐Ÿž - Entering an initial decimal in a numeric input field with selected text throws away decimal on alternate attempts

RickWassum opened this issue ยท 0 comments

Which package(s) are the source of the bug?

@maskito/kit

Playground Link

https://maskito.dev/kit/number

Description

  1. Click into the High Precision input
  2. Type 1
  3. Select the 1
  4. Type a period '.' and you will see '0.'
  5. Select the '0.'
  6. Type a period '.' and you will see the input is cleared and the placeholder displayed
    Expect it should again display '0.'

It appears there is some type of internal state that is perhaps not being set/reset properly, so if the input is selected and the first character you type is a period, then one time it will result in "0." and the next time it will be blank, throwing away the period, and it will continue to alternate this behavior. This can be an issue when tabbing into a field and attempting to enter a number starting with a decimal because the initial decimal entered may be thrown away so instead of enter .123 you end up with 123. This can be a problem, particularly if the user is entering data quickly and does not notice the error.

Maskito version

2.3.1

Which browsers have you used?

  • Chrome
  • Firefox
  • Safari
  • Edge

Which operating systems have you used?

  • macOS
  • Windows
  • Linux
  • iOS
  • Android