On Android the soft keyboard overlaid the layout viewport and the browser auto-scrolled the document on focus, dragging the shell (and its special-key bar) to the top of the screen and forcing a manual scroll. - index.html: interactive-widget=resizes-content so Chrome resizes the layout viewport instead of overlaying the keyboard, killing the auto-scroll. - viewport.ts: mirror visualViewport.offsetTop into --app-top for iOS / older browsers that ignore interactive-widget and still scroll under the keyboard. - styles.css: translateY(--app-top) re-pins #app to the visible region. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+4
-1
@@ -211,8 +211,11 @@ body {
|
||||
#app {
|
||||
/* `--app-vh` tracks the *visual* viewport (set by installViewportSizing) so
|
||||
the shell stays above the mobile soft keyboard; falls back to the layout
|
||||
viewport where `visualViewport` is unavailable. */
|
||||
viewport where `visualViewport` is unavailable. `--app-top` follows the
|
||||
layout viewport's scroll under the keyboard so the shell stays pinned to
|
||||
the visible region instead of drifting to the top. */
|
||||
height: var(--app-vh, 100%);
|
||||
transform: translateY(var(--app-top, 0px));
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
|
||||
Reference in New Issue
Block a user