parttio / textfieldformatter

TextField Formatter Vaadin add-on
Apache License 2.0
13 stars 9 forks source link

NumeralFieldFormatter move cursor wrong. #12

Closed jable8 closed 6 years ago

jable8 commented 6 years ago

Hi, thanks for the addon it looks very nice. I'm using the NumeralFieldFormatter.

new NumeralFieldFormatter(".", ",", 2).extend(txtMoneda);

If you type a number and then move the cursor to a previous position and start typing new numbers, NumeralFieldFormatter sometimes moves the cursor to the left of the new number typed, you can see this behavior also in Custom numeral formatting of the demo online.

You can reproduce this issue typing a number, for example 12345678,9, move the cursor between 7 and 8, then start typing 12345... you will see most of the time the cursor moves to the right when a new number is typed (as it should be) but sometimes it moves to the left.

I've checked the Numeral formatting on the Cleave.js demo and this issue never happens.

Do you know any way to avoid this issue?

Thanks in advance, Regards.

johannesh2 commented 6 years ago

Thanks for the report. I could first check if updating Cleave.js helps.

johannesh2 commented 6 years ago

With a quick test updating Cleave.js from 1.1 to 1.4 seems to help. I'll release an updated add-on.

jable8 commented 6 years ago

Ok, that sounds good!. Do you know more or less when are you going to update that? Because we've a release to a costumer coming soon and if this issue is not updated we would have to find another solution. Thanks you very much!

johannesh2 commented 6 years ago

Version 2.1 available in Maven.

johannesh2 commented 6 years ago

Demo updated to 2.1 also

johannesh2 commented 6 years ago

Please re-open if issue persists.

jable8 commented 6 years ago

The issue seems to me solved, thanks you very much! Regards