I have the problem of losing focus on an input element on a Samsung Galaxy Tab A (Android 7.0) with a html5 web application. It seems to be a problem in android, as on windows 10 or iOS (although the resize event is also triggered when the virtual keyboard pops up) the element does not lose focus. Windows 10 and iOS apparently suppress this when the virtual keyboard is called (but not when manually resizing the browser window). Anybody any help on this?
Asked
Active
Viewed 2,285 times
1 Answers
4
It's an Android issue losing focus due to the resize()
event.
Have you tried something like this for your resize functionality if something is not in focus:
$(window).bind('resize', function() {
if ($("input").is(":focus")) {
// Nothing will happen
} else {
// Other resize functions
}
});

Paul Redmond
- 3,276
- 4
- 32
- 52
-
Dear Paul, thanks for confirming that this is an Android issue and your suggestion. Unfortunately, my problem is that in my situation losing focus triggers a server callback. – dt2103 Jun 08 '17 at 13:01
-
Problem is, what if I want to keep my focused Input, but still activate my custom resize() code? – gene b. Apr 05 '18 at 14:38