This is for a HTML5/Javascript WebApp, not a native android app.
How do I prevent the browser/the DOM from resizing my content (which is responsive, mostly vw/vh for siz
Ok , this is fix for html5 (browser) app .
var isKeyboardOpen = false;
// Override onresize event if you have it already just insert code
// also you can check id of element or any other parameters
if (document.activeElement.tagName == "INPUT" ||
document.activeElement.tagName == "input") {
// regular onresize
}
else {
// avoid resize
}
// To check is it keyboard open use this code
window.addEventListener('native.showkeyboard', keyboardShowHandler);
window.addEventListener('native.hidekeyboard', keyboardHideHandler);
function keyboardShowHandler(e){
isKeyboardOpen = true; //always know status
}
function keyboardHideHandler(e){
isKeyboardOpen = false;
}
Initially try to prevent by setting the flag :
var object_ = document.getElementById("IwillOpenKeyboardOnMobile");
object_.addEventListener("focus", ONFOCUSELEMENT);
function ONFOCUSELEMENT() {
isKeyboardOpen = true;
}
// opposite event is blur