fix: use 100dvh so the chat input bar is reachable on mobile - #4
Open
kon-foo wants to merge 1 commit into
Open
Conversation
On mobile, 100vh is the large viewport — the height the page would have with the address bar retracted — so the layout is 64-80px taller than the screen. The input bar is the last element in it, and overflow:hidden on body means the page never scrolls, so the address bar never retracts and the overshoot is never recoverable: the bar is unreachable rather than merely below the fold. 100dvh tracks the currently visible height instead. 100vh stays as the fallback for browsers without dvh support.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current behaviour: the chat input bar is unreachable on small screens. It
renders below the fold, and
overflow: hiddenonbodymakes it unreachable —you cannot scroll to it. This only shows up on a real phone, where the browser's
address bar pushes the content down and out of the screen.
Fix: add
height: 100dvhso the actual visible height (screen minus addressbar) is used.
height: 100vhstays on the line above as the fallback forbrowsers that don't understand
dvh.Tested on a Pixel 8 in Firefox and Vanadium, portrait and landscape, before and
after: the input bar is off-screen by 64–80px before, fully visible after.
Note
I could not run
npm run build: on a clean clonepackage-lock.jsonresolves@open-gitagent/gitagenttofile:core.tgz, which is not in the repo, sonpm ciandnpm installboth fail with ENOENT. The change is CSS-only in afile the build step only copies. Happy to open that separately if it is news.