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

Problem with caret position while typing and formatting... #52

Open
Omid3d opened this issue Jan 23, 2016 · 1 comment
Open

Problem with caret position while typing and formatting... #52

Omid3d opened this issue Jan 23, 2016 · 1 comment

Comments

@Omid3d
Copy link

Omid3d commented Jan 23, 2016

Hi
Thanks for your great library.

But I have a problem that when I want to insert a digit between other digits, the caret jumps to the end of text. Actually when value has a character like comma, then the caret will jump to the end, if we set the value by script.
For example we have digits 465 and if we want to insert digit 9 between 4 and 6, caret will jump after 5, because the formatted value would be 4,965. I expected to see caret after last typed character (9) not the end of text.

Finally I found a fix for this issue and would like to explain that.
I Solved this issue by keeping remained length after current caret position in onKeyDown (key_check) event as lastRemainedLength,
and then update the position of caret in onKeyUp (price_it) event by new formatted value length minus lastRemainedLength.

Good luck

@flaviosilveira
Copy link
Collaborator

Some people ask to jump to the end, others to do not jump.
I think that do an option for that it is the better think to do.
Soon..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants