I\'ve written a web-page login form in ASP.net.
Using a Nexus 4, stock Android 4.2.1, native Chrome browser - when I click on the fields,
I had custom code in my $(window).resize(..) that I wanted to keep, and I wanted to restrict this workaround to only the specific use case being impacted (Android mobile only, Text Input or TextArea focus), so I came up with this:
function isAndroidTextInputFocus() {
var userAgent = navigator.userAgent.toLowerCase();
var isAndroid = userAgent.indexOf("android") != -1;
var result = (isAndroid &&
($("input[type=text]").is(":focus") || $("textarea").is(":focus"))
);
return result;
}
and then I tweaked my $(window).resize(..) like this:
$(window).resize(function(e) {
if (!isAndroidTextInputFocus()) {
// ... Proceed with my custom Window Resize logic
}
});