-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Incorrect cursor position and duplicate characters after separator on Android #416
Comments
Can you have a test with this http://jsfiddle.net/Tpr6N/4/ |
@RobinHerbots Thanks for the quick response. I tested the new version you sent but the behavior is still present. |
Can you send the useragent string 2014/1/24 Andrew Rota [email protected]
|
Mozilla/5.0 (Linux; Android 4.2.2; en-us; SAMSUNG SCH-I545 Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Version/1.0 Chrome/18.0.1025.308 Mobile Safari/535.19 |
FYI, I'm seeing this behavior on android 2.3 in this and 2 other plugins, as well as several native JS attempts. Seems to be a browser bug. |
Can you have some tests on the android stock browsers? |
@RobinHerbots User Agent stuff: I am also seeing this sometimes: |
This issue should be fixed with the latest commits in the 2.5 branch. I will have a look at the stock browser in android 2.3 through an emulator. |
Yes, I'll give it a try as soon as possible. |
@RobinHerbots I am not seeing any duplicate characters but it seems the carrot is still being placed in the wrong position after you pass a separator. This is happening in Firefox but not Chrome for a Galaxy phone. This happens in both browsers for a Galaxy Tablet. For example if I enter in 123456789 for mask of 999-99-9999 results in: 123-56-8974.
Also in Firefox and Chrome for Galaxy tablets and phones I am noticing that if the carrot gets to the end of the mask and you try to delete it wont allow it until you move the carrot in one character. I can create a new bug report for that. |
Did you clear the cache of the browser? I tested FF27 on my phone and the caret positioning was correct. Can you also submit the useragent strings. Thx for the feedback! |
@RobinHerbots Galaxy Tablet:Chrome:
Firefox:
Galaxy Phone:Chrome:
Firefox:
Edit: CodePen: http://codepen.io/rizowski/pen/KfmzA |
Testing out the phone on codepen worked out well. The issue is still there for Firefox26.01 and it has gone away for Chrome. |
http://jsfiddle.net/UJvN7/5 Can this version be tested on FF |
Entered 123abc and got 123-bca on the Galaxy tablet and phone for FF on both fields |
So I have been looking over some of the code. There are some places that could be refactored a bit to make it a little easier to read. I was also noticing that when you delete characters for the mobile phone in Firefox and you go past a separator character the caret will jump back to the separator. I get the feeling this is being caused by one of the functions that resets the caret. Examples of what I am talking about: 123-45-____
I have also noticed the caret will temporarily jump back to the very end of the mask and then readjust. 123-45-678_ Hope this helps clears some things up. |
I think I was able to fix it. It is working on my devices with switching 1121 line to false instead of true. A pull request has been made. |
See comment pull request #435 A last fiddle http://jsfiddle.net/UJvN7/15/ |
Just a heads up, this is not reproducible on Chrome for Android 4.4.2 (Moto G). Typing "jonathan" in the above script, outputs the following:
|
originalEvent: [object CompositionEvent] ||| type: compositionstart ||| isDefaultPrevented: function returnFalse() { return false; } ||| timeStamp: 1400697466262 ||| jQuery1910650616864906624: true ||| which: 0 ||| view: [object Window] ||| target: [object HTMLInputElement] ||| shiftKey: undefined ||| relatedTarget: undefined ||| metaKey: false ||| eventPhase: 2 ||| currentTarget: [object HTMLInputElement] ||| ctrlKey: undefined ||| cancelable: true ||| bubbles: true ||| altKey: undefined ||| delegateTarget: [object HTMLInputElement] ||| handleObj: [object Object] ||| data: undefined ||| isPropagationStopped: function returnFalse() { return false; } ||| isImmediatePropagationStopped: function returnFalse() { return false; } ||| preventDefault: function () { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } } ||| stopPropagation: function () { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; } ||| stopImmediatePropagation: function () { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } ||| ========== originalEvent: [object CompositionEvent] ||| type: compositionupdate ||| isDefaultPrevented: function returnFalse() { return false; } ||| timeStamp: 1400697466322 ||| jQuery1910650616864906624: true ||| which: 0 ||| view: [object Window] ||| target: [object HTMLInputElement] ||| shiftKey: undefined ||| relatedTarget: undefined ||| metaKey: false ||| eventPhase: 2 ||| currentTarget: [object HTMLInputElement] ||| ctrlKey: undefined ||| cancelable: true ||| bubbles: true ||| altKey: undefined ||| delegateTarget: [object HTMLInputElement] ||| handleObj: [object Object] ||| data: undefined ||| isPropagationStopped: function returnFalse() { return false; } ||| isImmediatePropagationStopped: function returnFalse() { return false; } ||| preventDefault: function () { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } } ||| stopPropagation: function () { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; } ||| stopImmediatePropagation: function () { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } ||| ========== originalEvent: [object Event] ||| type: input ||| isDefaultPrevented: function returnFalse() { return false; } ||| timeStamp: 1400697466351 ||| jQuery1910650616864906624: true ||| which: undefined ||| view: undefined ||| target: [object HTMLInputElement] ||| shiftKey: undefined ||| relatedTarget: undefined ||| metaKey: false ||| eventPhase: 2 ||| currentTarget: [object HTMLInputElement] ||| ctrlKey: undefined ||| cancelable: false ||| bubbles: true ||| altKey: undefined ||| delegateTarget: [object HTMLInputElement] ||| handleObj: [object Object] ||| data: undefined ||| isPropagationStopped: function returnFalse() { return false; } ||| isImmediatePropagationStopped: function returnFalse() { return false; } ||| preventDefault: function () { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } } ||| stopPropagation: function () { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; } ||| stopImmediatePropagation: function () { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } ||| ========== originalEvent: [object CompositionEvent] ||| type: compositionend ||| isDefaultPrevented: function returnFalse() { return false; } ||| timeStamp: 1400697469685 ||| jQuery1910650616864906624: true ||| which: 0 ||| view: [object Window] ||| target: [object HTMLInputElement] ||| shiftKey: undefined ||| relatedTarget: undefined ||| metaKey: false ||| eventPhase: 2 ||| currentTarget: [object HTMLInputElement] ||| ctrlKey: undefined ||| cancelable: true ||| bubbles: true ||| altKey: undefined ||| delegateTarget: [object HTMLInputElement] ||| handleObj: [object Object] ||| data: undefined ||| isPropagationStopped: function returnFalse() { return false; } ||| isImmediatePropagationStopped: function returnFalse() { return false; } ||| preventDefault: function () { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } } ||| stopPropagation: function () { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; } ||| stopImmediatePropagation: function () { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } ||| ========== originalEvent: [object Event] ||| type: input ||| isDefaultPrevented: function returnFalse() { return false; } ||| timeStamp: 1400697469735 ||| jQuery1910650616864906624: true ||| which: undefined ||| view: undefined ||| target: [object HTMLInputElement] ||| shiftKey: undefined ||| relatedTarget: undefined ||| metaKey: false ||| eventPhase: 2 ||| currentTarget: [object HTMLInputElement] ||| ctrlKey: undefined ||| cancelable: false ||| bubbles: true ||| altKey: undefined ||| delegateTarget: [object HTMLInputElement] ||| handleObj: [object Object] ||| data: undefined ||| isPropagationStopped: function returnFalse() { return false; } ||| isImmediatePropagationStopped: function returnFalse() { return false; } ||| preventDefault: function () { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } } ||| stopPropagation: function () { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; } ||| stopImmediatePropagation: function () { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } ||| ========== |
see #465 |
Demo: http://jsfiddle.net/Tpr6N/2/
JS Code:
Steps to reproduce:
Note: Sometimes this behavior is inconsistent following the above steps. But trying the same thing a second or third time usually ends up causing the bug.
Device: Samsung Galaxy S4 SCH-I545
OS: Android 4.2.4
Browser: Native Android browser
(Don't know if this is considered a duplicate of #368, but it seems like a distinct bug)
The text was updated successfully, but these errors were encountered: