Keep the iOS keyboard up on a second tap of the token field - #7
Merged
Merged
Conversation
lib/viewport.ts pinned the page at (0, 0) on every visual-viewport resize and scroll, including on the token gate. iOS scrolls a focused field into view when the keyboard opens and again when the field is tapped, so a second tap on the token field (to paste) landed after the page jumped back, off the field, and dismissed the keyboard. Only the shell (.app) is pinned now, and the gate sizes itself to the visible height, which centres the card above the keyboard and leaves iOS nothing to scroll. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merged
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.
Summary
On an iPhone, tapping the token field a second time (to get the Paste menu) closed the keyboard.
Cause.
lib/viewport.tsscrolls the page back to (0, 0) on every visual-viewportresizeandscroll. It is meant to keep the shell's header and key bar on screen, but it also ran on the token gate. iOS scrolls a focused field into view when the keyboard opens, and again when the field is tapped. The page jumped back each time, so the second tap landed outside the field. A tap outside the field blurs it, and the keyboard closed.Fix.
.app) is pinned to the top now. The gate is left alone.--app-height, the valueviewport.tsalready sets). That centres the card above the keyboard, so iOS has nothing to scroll.Two files changed, 9 lines added. Independent of #5 and #6.
Testing
bun run typecheckpasses andbun testpasses 252/252 onmain.window.scrollTois never called, even after the viewport shrinks as it would for a keyboard.🤖 Generated with Claude Code