Skip to content

Keep the iOS keyboard up on a second tap of the token field - #7

Merged
devswha merged 1 commit into
devswha:mainfrom
Yoonwoo-Ha:fix/ios-token-gate-keyboard
Sep 23, 2026
Merged

devswha merged 1 commit into
devswha:mainfrom
Yoonwoo-Ha:fix/ios-token-gate-keyboard

Conversation

@Yoonwoo-Ha

Copy link
Copy Markdown
Contributor

Summary

On an iPhone, tapping the token field a second time (to get the Paste menu) closed the keyboard.

Cause. lib/viewport.ts scrolls the page back to (0, 0) on every visual-viewport resize and scroll. 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.

  • Only the shell (.app) is pinned to the top now. The gate is left alone.
  • The gate sizes itself to the visible height (--app-height, the value viewport.ts already 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 typecheck passes and bun test passes 252/252 on main.
  • In headless Chrome with the iPhone 13 device profile, against a token-protected test server:
    • While the gate shows, window.scrollTo is never called, even after the viewport shrinks as it would for a keyboard.
    • A second tap keeps the field focused.
    • The gate fills the visible height, and the field sits inside it.
    • After unlocking, the shell is still pinned when the viewport resizes.
  • The iOS keyboard itself can't be emulated. The WebKit check did not run because the installed WebKit build doesn't match playwright-core.

🤖 Generated with Claude Code

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>
@Yoonwoo-Ha Yoonwoo-Ha mentioned this pull request Sep 23, 2026
@devswha
devswha merged commit eda3759 into devswha:main Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants