remote trackpad and keyboard server
git clone https://git.lucas.co/cce-remote.git
fix: drop safe-area bottom padding while the keyboard is up
The body reserves env(safe-area-inset-bottom) (~34px standalone) for the home
indicator, but the keyboard covers that area — so inside the keyboard-fitted
layout the reservation just hovered the click buttons that far above the
keyboard top. Zeroed while fitted, restored with the rest on close.
Co-Authored-By: Claude Fable 5 <[email protected]>
index.html | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/index.html b/index.html
index a69e7bc..e8d11e9 100644
--- a/index.html
+++ b/index.html
@@ -498,6 +498,11 @@ const vv = window.visualViewport;
function fitViewport() {
const short = vv && vv.height < window.innerHeight * 0.85;
document.body.style.height = short ? vv.height + "px" : "";
+ // The keyboard covers the home-indicator area, so the safe-area bottom
+ // padding (~34px in standalone) would hover the click buttons that far
+ // above the keyboard. It exists to dodge the indicator; the keyboard is
+ // dodging it for us.
+ document.body.style.paddingBottom = short ? "0px" : "";
document.body.style.transform = short && vv.offsetTop > 0
? "translateY(" + vv.offsetTop + "px)"
: "";