From 567729f6f8de9e422661290ccf57462ab0c7b6f5 Mon Sep 17 00:00:00 2001 From: Ginger Wong Date: Mon, 15 Jun 2020 13:43:41 -0700 Subject: [PATCH] calc resize on android on message field focus --- webroot/index.html | 8 ++++++++ webroot/js/message.js | 2 ++ webroot/js/utils.js | 7 +++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/webroot/index.html b/webroot/index.html index fbee04ea8..d722a8c95 100644 --- a/webroot/index.html +++ b/webroot/index.html @@ -1,3 +1,4 @@ + @@ -15,7 +16,14 @@ +
diff --git a/webroot/js/message.js b/webroot/js/message.js index 09e1164bb..eb7b15f88 100644 --- a/webroot/js/message.js +++ b/webroot/js/message.js @@ -105,9 +105,11 @@ class Messaging { handleKeyboardAppear() { this.tagAppContainer.classList.add("android-message-focus"); + setVHvar(); } handleKeyboardOut() { this.tagAppContainer.classList.remove("android-message-focus"); + setVHvar(); } handleChatToggle() { diff --git a/webroot/js/utils.js b/webroot/js/utils.js index 7eea4bfc0..2a1cbdb0a 100644 --- a/webroot/js/utils.js +++ b/webroot/js/utils.js @@ -39,9 +39,10 @@ function uuidv4() { } function setVHvar() { - let vh = window.innerHeight * 0.01; + var vh = window.innerHeight * 0.01; // Then we set the value in the --vh custom property to the root of the document document.documentElement.style.setProperty('--vh', `${vh}px`); + console.log("== new vh", vh) } function mobileVHhack() { setVHvar(); @@ -52,4 +53,6 @@ function isAndroidMobile() { var isAndroid = navigator.userAgent.toLowerCase().indexOf("android") > -1; //&& ua.indexOf("mobile"); return isAndroid; -} \ No newline at end of file +} + +