diff --git a/server/public/home.html b/server/public/home.html index c81aaeb..a6e21c8 100644 --- a/server/public/home.html +++ b/server/public/home.html @@ -1117,7 +1117,7 @@
- }; window.__bzFindOverflow=findOverflow; window.addEventListener('load', function(){ setTimeout(function(){ bzDbg('load',{overflow:findOverflow()}); }, 900); }); - if(window.visualViewport){ var t; window.visualViewport.addEventListener('resize', function(){ clearTimeout(t); t=setTimeout(function(){ bzDbg('kb',{overflow:findOverflow()}); }, 300); }); } + if(window.visualViewport){ var t; window.visualViewport.addEventListener('resize', function(){ clearTimeout(t); t=setTimeout(function(){ + var vv=window.visualViewport; var comp=document.querySelector('.composer'); var cr=comp?comp.getBoundingClientRect():null; + var kbTop=Math.round(vv.height+vv.offsetTop); // bottom of the visible area = top of the keyboard + bzDbg('kb',{ curKb:getComputedStyle(document.documentElement).getPropertyValue('--kb').trim(), kbOpen:document.body.classList.contains('kb-open'), compBottom:cr?Math.round(cr.bottom):-1, kbTop:kbTop, coveredBy:cr?Math.round(cr.bottom-kbTop):null }); + }, 250); }); } })();