-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Cursor position should be restored after change #150
Conversation
This reverts commit f6338b4.
Last commit "Added new custom option to prevent stripLeadingZeroes" is not related, but added option default doesn't change current behaviour, only if you explicitly set it to false. The reason for not stripping zeroes is because if you have a number like "100,000" and you want to change it to "200,000" you don't necessary want to see it going to "0" before typing all the zeroes again. This option preserves the leading zeroes in this case. |
Very nice, you are my hero! |
@reborg Awesome! Seems like this breaks the react component tho :/ |
@reborg as you can see, I've fixed the problem with React component being broken and created a separate PR (since I don't know what should be the proper way of me pushing changes to your branch here). If there is something wrong with that, please contact me so we can resolve it whatever way you like (as you are the original author of the fix). |
Any update on this? Thanks. |
@mdziekon you can do a pull request here https://github.com/reborg/cleave.js if you want to do that |
There's an edge case here, with the following options: |
I think this solves the jump of the cursor to the right for every change mentioned here #25, at least in some of the use cases I've tested on the number formatter. I didn't try this on the react part (although I think the change applies the same) or other type of inputs.