-
Notifications
You must be signed in to change notification settings - Fork 167
fix(mask): Fix to wrong caret position in android devices #136
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
base: master
Are you sure you want to change the base?
Conversation
In all browsers in android devices the keyboard cursor is in the wrong position in fields that have a mask closes candreoliveira#32 candreoliveira#58 candreoliveira#127
|
This would be great! Thanks weberamaral! (Can we get this merged?) |
|
Hey @mKurrels how are you? Hope all is well. |
|
@weberamaral |
Implemented according with pull request candreoliveira#136 on oficial repository requested by https://github.com/weberamaral
|
This solution works when testing in the emulator (Nexus 6P) but not when testing on these two devices: Samsung S7 and Huawei honor 9. |
|
Me too was with the same bug of wrong caret position. But after aplied the pull request of @weberamaral the problem was solved in my device. But in another device (another android version) testing I noticed that the problem continue. To solve this I added the following code after 142 line: if (value !== viewValueWithDivisors) {
controller.$viewValue = angular.copy(viewValueWithDivisors);
controller.$render();
$timeout(function() {
setSelectionRange(viewValueWithDivisors.length);
$element[0].focus();
$element[0].setSelectionRange(viewValueWithDivisors.length, viewValueWithDivisors.length + 1);
});
} |
|
@julitroalves this code work fine on my Android 4.4.4! Trying on Iphone now! |
|
@julitroalves Great solution, this works on my Samsung S7 with Android 7.0. Finally, we have a solution to this! Can we merge this into the master branch please? |
|
I tested it out, and needed to take what he had, and wrap it around an adroid check because that change didn't work on iphone... This is what worked for me (there's more elegant ways to do it)? |
In all browsers in android devices the keyboard cursor is in the wrong position in fields that have
a mask
closes #32 #58 #127