Actual Behavior:
What is the issue? *
In Ionic, on android, it's not possible to move cursor in between text on input fields. The issue described here, solved a few months ago, re-appears on android touch devices (not on browsers) when including ngMaterial.Steps to reproduce the issue:
Angular Versions: *
Angular Version:
1.5.3Angular Material Version:
1.1.1Additional Information:
Browser Type: *
Ionic on samsung tab E (or any other android touch device)Browser Version: *
ionic 1.3.1OS: *
AndroidActual Behavior:
What is the issue? *
In Ionic, on android, it's not possible to move cursor in between text on input fields. The issue described here, solved a few months ago, re-appears on android (not on browsers) when including ngMaterial.Steps to reproduce the issue:
Angular Versions: *
Angular Version:
1.5.3Angular Material Version:
1.1.1Additional Information:
Browser Type: *
Ionic on samsung tab E (or any other android touch device)Browser Version: *
ionic 1.3.1OS: *
AndroidSolution Found!
Inspired by the solution of this similar ionic issue, I commented out ev.preventDefault() in the mouseInputHijacker(ev) function of angular-material.js and the bug is gone.
function mouseInputHijacker(ev) {
var isKeyClick = !ev.clientX && !ev.clientY;
if (!isKeyClick && !ev.$material && !ev.isIonicTap
&& !isInputEventFromLabelClick(ev)) {
//ev.preventDefault(); => When commenting out this line the bug disappears (line 2669 in angular-material.js)
ev.stopPropagation();
}
}
I have no idea whether removing this line could cause new bugs or not ? (it did not in the mentionned issue)
I am not familiar with testing and creating a pull request for such an important package.
Could someone help me with that?
Another workaround without altering the ngMaterial source code. Add this to your config :
.config(function($mdGestureProvider) {
$mdGestureProvider.skipClickHijack();
}))
As described in this ionic issue this also solves other ionic issues.
@robindierckx Do you know if there are any side effect of skipping hijacking?
no idea, sorry. I did not experience any trouble though.
That's ok. Thanks for the quick response!
The solution in https://github.com/angular/material/issues/10058#issuecomment-263690370 seems like the best way to go here w/o risking any breaking changes to AngularJS Material.
Most helpful comment
Another workaround without altering the ngMaterial source code. Add this to your config :
As described in this ionic issue this also solves other ionic issues.