vue-number-format icon indicating copy to clipboard operation
vue-number-format copied to clipboard

Empty prefix causes weird behaviour

Open huubbouma opened this issue 1 year ago • 4 comments

This can be seen in the playground https://vue-number-format.netlify.app/guide/play-ground.html

steps to reproduce:

  • Clear the prefix field and leave a dot as the seperator (and comma as decimal)
  • Now start typing: 12345

As soon as you type the 5 a comma appears

After a blur (hit tab) the number changes to: 1,23

(Either fill in a prefix, or change the seperator to something else and everything works fine)

huubbouma avatar Jan 30 '24 20:01 huubbouma

Thanks for reporting, we just had a very similar faulty outcome which seems to be related.

Reproduction steps:

  1. Remove prefix (value turns to 1.234,57)
  2. Change decimals to 0 (value turns to 1.235)
  3. Focus the input field (just click in it, no change required)
  4. Blur the input field (value turns to 1)

We could overcome the issue by using a Unicode period instead of the "normal" one but we are nonetheless looking forward to a fix.

Niccober avatar Jan 30 '24 22:01 Niccober

@Niccober

We could overcome the issue by using a Unicode period instead of the "normal" one but we are nonetheless looking forward to a fix.

Smart thinking :-) I implemented a similar workaround, by using the unicode character of ​ for the prefix field

huubbouma avatar Jan 31 '24 06:01 huubbouma

Same problem here, can someone provide me with a workaround example?

dluccajose avatar Feb 19 '24 19:02 dluccajose

Same problem here, can someone provide me with a workaround example?

Just fill in a character in the prefix option. There are Unicode characters which are sort of invisible like the NegativeMediumSpace character. That worked for me.

huubbouma avatar Feb 19 '24 22:02 huubbouma

Use latest version, I have fix the issue.

dipaksarkar avatar Dec 13 '24 09:12 dipaksarkar