-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Fix mobile unwanted scrolling #16356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mobile unwanted scrolling #16356
Conversation
d198e5c
to
1f8196c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ServeurpersoCom It'd be much better to utilize <svelte:window bind:innerHeight>
, like:
let innerHeight = $state<number | undefined>();
// ...
<svelte:window bind:innerHeight />
// ...
<div
class="flex h-screen w-full"
style:height="{innerHeight}px"
>
(conditional is not needed as Svelte ignores invalid values and doesn't add the style:
if innerHeight
is invalid)
5201216
to
3e032f8
Compare
@ServeurpersoCom plz just run |
9fd4f5a
to
fe620c0
Compare
@ServeurpersoCom let's address the merge conflict and merge this PR |
fe620c0
to
01e4a2a
Compare
…rolling Use <svelte:window bind:innerHeight> instead of manual resize listener Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
01e4a2a
to
8b9405b
Compare
* origin/master: (124 commits) metal : fix loop bound in ggml_mem_ranges (ggml-org#16412) llama : fix shapes for bert/mpt q/k norm (ggml-org#16409) ggml : fix graph reallocation with multiple chunks (ggml-org#16396) Fix missing messages on sibling navigation (ggml-org#16408) vulkan: Replace uses of maxMemoryAllocationSize and VK_WHOLE_SIZE (ggml-org#16354) vulkan: Fix FA coopmat1 invalid array indexing (ggml-org#16365) ci : change macos-13 to macos-15-intel (ggml-org#16401) Capture model name only after first token (streaming) or completed request (ggml-org#16405) vulkan: in flash attention, bounds check against nem1 (don't rely on GGML_KQ_MASK_PAD) (ggml-org#16316) webui : Fix messages payload sent to chat completions (ggml-org#16402) fix: track viewportHeight via window.innerHeight to avoid unwanted scrolling (ggml-org#16356) test-barrier : do not use more threads than physically available (ggml-org#16389) ggml webgpu: add support for soft_max, optimize rms_norm (ggml-org#16357) model : Apertus model implementation (ggml-org#15852) musa: update compile flags (ggml-org#16265) ci : fix ubuntu-latest-cmake-rpc (disable ccache) (ggml-org#16388) ci: update vulkan ci (ggml-org#16294) ci : fix clean-up of old logs (ggml-org#16381) SYCL: Update to oneAPI 2025.2 (ggml-org#16371) HIP: add IMbackK to codeowner (ggml-org#16375) ...
Make sure to read the contributing guidelines before submitting a PR
Description
This patch introduces dynamic viewport height handling in the main Svelte WebUI layout.
Problem
Using Tailwind’s h-screen relies on the CSS visual viewport height, which often doesn’t match the actual available space in the browser. On mobile devices (iOS/Android), the browser’s address bar appearing/disappearing leads to layout jumps, empty gaps, or hidden content. The UI isn’t always filling the screen as expected.
Solution
Added a reactive viewportHeight state, updated on every window.resize.
On onMount, the value is initialized with window.innerHeight.
The root container’s height is conditionally set with an inline style:height={viewportHeight}px.
Event listeners are properly cleaned up on unmount.
This ensures the layout always matches the real viewport height instead of relying on 100vh/h-screen quirks.
Benefits
Mobile UX is fixed: no more ghost scrollbars or clipped areas when the browser chrome toggles.
No regressions on desktop: viewportHeight just tracks the window height.
Lightweight, clean solution with minimal code changes.