-
Notifications
You must be signed in to change notification settings - Fork 255
Incorrectly positioned cursor in MS Edge browser #46
Comments
I found the same problem on Google Chrome 45.0 of an Android device (Galaxy Tab). The cursor fulfill the first character but stay at this position even when we insert new ones. The result is that the inserted word/number is inserted reversed (except for the first letter). |
Changing the type attribute on the input element from "text" to "tel" seems to fix the issue.
I've tested this out in MS Edge, and in Google Chrome v45.0 on both Galaxy S6 and Galaxy Note 3. |
Instead of changing the attribute have you tried removing the From the readme:
|
looks like at the time the IE edge focus event is fired the browser hasn't set the cursor yet (we get a cursor position of 0). One possible solution to this is to timeout all the events in the eventsToHandle array. For example:
|
None of suggested fixes resolved issue for me. |
Hi guys, Any update on this ? |
I'm pretty sure the code snippet above fixes it, I'll have to test again and after that I'll submit a PR. If you get a chance, you want to test out the fix also? |
Guys, Interesting reading up on this masking issue that we only discovered on certain android devices (samsung in general). |
@mattiLeBlanc Another thing that you can do is remove the Something like this: var isAndroid = /(android)/i.test(navigator.userAgent);
if (isAndroid) {
var index = uiMaskConfig.eventsToHandle.indexOf('input');
uiMaskConfig.eventsToHandle.splice(index, 1);
} |
I am happy to use type="tel" because i am validating a phone number. No reason to fork the repo and change the event, right? |
No need to fork the repo at all to do the above fix. Probably should have given you a little more context though sorry about that. For example, if you include the above code snippet in your main angular app.run(['uiMaskConfig', function(uiMaskConfig) {
//insert code snippet here
}); This would be much easier if the |
Ah, I see. Thanks for that. |
@lukepfeiffer10 I'm facing the same issue on Webkit running on Android devices. I tried tu use the code snippet you sugested above, however, when I try to delete the digits, the cursor gets stucked on the first character of the mask it encouters. e.g: with this mask: with the cursor at the end of the input: when trying to delete digits it works great until it encounter the char of the mask. If I manually change the cursor position I can keep deleting until it finds a new mask char. I've tried it with many different masks and it keep presenting the same behavior. Any Ideas on what might be going on? Thanks :) |
@wanderleypanosso First thing I would check is make sure you are using the latest version. I wasn't able to recreate the issue using Chrome on a desktop but that doesn't necessarily mean your issue isn't valid I just don't have an easy way to test on an Android device currently. |
Still getting the error - by the way, the bug can be replicated on the demo page as well. This is what I've tried: To replicate the error on the demo page:
Does anyone have any other suggestions? |
I think this solves this problem. I included a description of what caused the bug in the pull request information. |
Hello
Thanks for great control, guys!
Issue is that when you place cursor in input with mask in MS Edge browser it is placed in the beginning of input. In other browsers it is correctly positioned after last filled in character.
I've tried to fix this by myself but without success.
I've created plunkr.
Try to put cursor in first input in Edge and you'll see it is before "4" character.
The text was updated successfully, but these errors were encountered: