Skip to content

fix(app): resize layout viewport when mobile keyboard appears - #15841

Merged
adamdotdevin merged 1 commit into
anomalyco:devfrom
BYK:fix/mobile-keyboard-viewport
Mar 27, 2026
Merged

fix(app): resize layout viewport when mobile keyboard appears#15841
adamdotdevin merged 1 commit into
anomalyco:devfrom
BYK:fix/mobile-keyboard-viewport

Conversation

@BYK

@BYK BYK commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #15842

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The viewport meta tag defaults to interactive-widget=resizes-visual, which means the virtual keyboard overlays the visual viewport without resizing the layout viewport. Since the root element uses h-dvh and dvh tracks the layout viewport, the full flex layout stays at its original height behind the keyboard — pushing the composer (shrink-0 at the bottom of a flex-col) under it.

Adding interactive-widget=resizes-content tells the browser to resize the layout viewport (and thus the ICB) when the keyboard appears. dvh then shrinks to the space above the keyboard, the message timeline (flex-1) absorbs the reduction, and the composer stays visible.

Desktop is unaffected (no virtual keyboard = no viewport change). Browser support: Chrome 108+, Safari 15+, Edge 108+.

How did you verify your code works?

Tested on iOS Safari and Chrome Android — the composer stays visible above the keyboard after the change.

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR
@BYK
BYK requested a review from adamdotdevin as a code owner March 3, 2026 13:03
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Mar 3, 2026
@github-actions

github-actions Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

PR #13155 is related to iOS/Safari viewport issues but appears to be about scrolling, not the keyboard viewport problem. Let me verify it's not a duplicate:

No duplicate PRs found

The search results only return PR #15841 (the current PR being checked) and PR #13155, which is about improving initial bottom scroll on iOS/iPad Safari - a different viewport-related issue, not about the mobile keyboard covering the input area.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 3, 2026
@github-actions

github-actions Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@BYK

BYK commented Mar 13, 2026

Copy link
Copy Markdown
Contributor Author

@adamdotdevin any luck?

@BYK
BYK force-pushed the fix/mobile-keyboard-viewport branch 2 times, most recently from add3667 to 863eb40 Compare March 16, 2026 15:05
@BYK
BYK force-pushed the fix/mobile-keyboard-viewport branch 5 times, most recently from 71a9807 to b3ba39f Compare March 25, 2026 10:46
Add interactive-widget=resizes-content to the viewport meta tag so the
layout viewport (and dvh) shrinks when the virtual keyboard opens. The
existing flex layout then keeps the composer visible above the keyboard.
@BYK
BYK force-pushed the fix/mobile-keyboard-viewport branch from dd07dcd to 6d2c9d0 Compare March 26, 2026 12:25
@adamdotdevin
adamdotdevin merged commit bdd7829 into anomalyco:dev Mar 27, 2026
8 checks passed
Copilot AI pushed a commit to ian-morgan99/opencode that referenced this pull request Mar 28, 2026
…yco#15841)

Co-authored-by: ian-morgan99 <106852423+ian-morgan99@users.noreply.github.com>
loocor pushed a commit to loocor/opencode that referenced this pull request Mar 30, 2026
balcsida pushed a commit to balcsida/opencode that referenced this pull request Apr 8, 2026
RobertWsp pushed a commit to RobertWsp/opencode that referenced this pull request Apr 16, 2026
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
avion23 pushed a commit to avion23/opencode that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants