Skip to content

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

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

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

Conversation

@BYK
Copy link
Copy Markdown
Contributor

@BYK BYK commented Mar 3, 2026

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
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

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
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

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
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

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

@BYK
Copy link
Copy Markdown
Contributor Author

BYK commented Mar 13, 2026

@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
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.

Mobile keyboard covers prompt input in web UI

2 participants