diff --git a/server/public/home.html b/server/public/home.html index 144f9f1..bef100a 100644 --- a/server/public/home.html +++ b/server/public/home.html @@ -1112,7 +1112,7 @@
- // The plugin reports that height in DEVICE PIXELS on some builds, but CSS wants points — so a raw value // bigger than the screen's point height is divided by devicePixelRatio. This normalization makes it land // exactly on the keyboard regardless of unit. - function bzKbHeight(raw){ raw=raw||0; var dpr=window.devicePixelRatio||1; return Math.round(raw > window.innerHeight ? raw/dpr : raw); } + // Measured on-device: the plugin's reported height puts the composer ~2x too high, so scale it. This is + // a single tunable number — if the composer isn't flush on the keyboard, nudge KB_FACTOR up/down. + var KB_FACTOR=0.52; + function bzKbHeight(raw){ raw=raw||0; var dpr=window.devicePixelRatio||1; var norm = raw > window.innerHeight ? raw/dpr : raw; return Math.round(norm*KB_FACTOR); } var KB=C.Plugins&&C.Plugins.Keyboard; if(KB && KB.addListener){ KB.addListener('keyboardWillShow', function(info){ var h=bzKbHeight(info&&info.keyboardHeight); r.style.setProperty('--kb', h+'px'); document.body.classList.add('kb-open'); var b=document.getElementById('msgs'); if(b) requestAnimationFrame(function(){ b.scrollTop=b.scrollHeight; }); });