From c397e28a5f2bf110b9e3a8026fe7c2574ba588f1 Mon Sep 17 00:00:00 2001 From: haorwen Date: Sun, 28 Jun 2026 07:58:14 +0800 Subject: [PATCH] chore: bump version to 0.9.97 fix: skip visualViewport height in iframe to prevent mobile layout collapse --- package.json | 2 +- src/hooks/useVirtualKeyboard.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index dc4a51d6..f1fd309e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vocechat-web", - "version": "0.9.96", + "version": "0.9.97", "homepage": "https://voce.chat", "dependencies": { "@metamask/onboarding": "^1.0.1", diff --git a/src/hooks/useVirtualKeyboard.ts b/src/hooks/useVirtualKeyboard.ts index 24586a38..a42a1ff4 100644 --- a/src/hooks/useVirtualKeyboard.ts +++ b/src/hooks/useVirtualKeyboard.ts @@ -17,9 +17,14 @@ const isIOS = () => * `-webkit-fill-available`, so we skip it there to avoid the container * being over-shrunk when the keyboard opens. */ +const isInIframe = () => window.location !== window.parent.location; + export default function useVirtualKeyboard() { useEffect(() => { - if (isIOS()) return; + // In an iframe, visualViewport.height reflects the intersection of the + // iframe with the parent's viewport, not the iframe's own height. + // 100vh already equals the iframe's own height, so skip setting --vh-visible. + if (isIOS() || isInIframe()) return; const vv = window.visualViewport;