Skip to content

fix(web): prevent iOS auto-zoom on chat input focus#1292

Open
murataslan1 wants to merge 1 commit intopingdotgg:mainfrom
murataslan1:fix/mobile-input-zoom
Open

fix(web): prevent iOS auto-zoom on chat input focus#1292
murataslan1 wants to merge 1 commit intopingdotgg:mainfrom
murataslan1:fix/mobile-input-zoom

Conversation

@murataslan1
Copy link

@murataslan1 murataslan1 commented Mar 22, 2026

Summary

Fixes the iOS auto-zoom that occurs when focusing the chat composer input, causing layout shifts and broken sticky headers.

Root Cause

iOS Safari/Chrome automatically zoom into input fields with font-size below 16px. The composer editor (ComposerPromptEditor.tsx) used text-[14px], which triggers this behavior on mobile devices.

Fix

  • Set composer font-size to 16px on mobile viewports, 14px on sm+ (matching placeholder)
  • Add maximum-scale=1 to the viewport meta tag to prevent auto-zoom on all inputs

Test plan

  • Open t3code on iOS Safari/Chrome
  • Tap the chat input
  • Verify no zoom occurs and sticky header/footer stay in place

Fixes #1265

Note

Prevent iOS auto-zoom on chat input focus

  • Sets font-size to 16px (iOS's zoom threshold) on the chat input in ComposerPromptEditor.tsx, reverting to 14px at the sm breakpoint and above.
  • Adds maximum-scale=1.0 to the viewport meta tag in index.html as a secondary safeguard.
  • Behavioral Change: maximum-scale=1.0 disables user-initiated pinch-to-zoom on all browsers that respect it.

Macroscope summarized 47f5a8f.

iOS Safari and Chrome auto-zoom when focusing an input with font-size
below 16px. The composer editor used text-[14px], triggering this
behavior and causing layout shifts.

- Set composer font-size to 16px on mobile, 14px on sm+ breakpoint
- Add maximum-scale=1 to viewport meta to prevent zoom on all inputs

Fixes pingdotgg#1265
Copilot AI review requested due to automatic review settings March 22, 2026 00:08
@coderabbitai
Copy link

coderabbitai bot commented Mar 22, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 39b0ce37-1441-452b-a2e3-bd2966caf569

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use your project's `biome` configuration to improve the quality of JS/TS/CSS/JSON code reviews.

Add a configuration file to your project to customize how CodeRabbit runs biome.

@github-actions github-actions bot added size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 22, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses iOS Safari/Chrome auto-zoom and resulting layout shifts when focusing the chat composer by increasing the effective font-size on small viewports and adjusting the app’s viewport configuration.

Changes:

  • Update the chat composer editor and placeholder to use 16px font-size on mobile (sm breakpoint and below) while keeping 14px on sm+.
  • Update index.html viewport meta tag to include maximum-scale=1.0.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
apps/web/src/components/ComposerPromptEditor.tsx Adjusts composer editor + placeholder font sizing to avoid iOS focus auto-zoom.
apps/web/index.html Modifies viewport meta tag to limit page scaling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting maximum-scale=1.0 in the viewport meta tag effectively disables pinch-zoom across the entire app on mobile browsers, which is an accessibility regression (users who rely on zoom can no longer enlarge text/UI). Consider removing maximum-scale and addressing iOS input auto-zoom via font-size >= 16px on focus/for mobile (or other targeted iOS-only styling) instead of globally restricting zoom.

Suggested change
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

Copilot uses AI. Check for mistakes.
Comment on lines 1096 to +1107
@@ -1104,7 +1104,7 @@ function ComposerPromptEditorInner({
}
placeholder={
terminalContexts.length > 0 ? null : (
<div className="pointer-events-none absolute inset-0 text-[14px] leading-relaxed text-muted-foreground/35">
<div className="pointer-events-none absolute inset-0 text-[16px] sm:text-[14px] leading-relaxed text-muted-foreground/35">
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The codebase generally uses Tailwind semantic font-size utilities (e.g., text-base on mobile with sm:text-sm) for form controls to avoid iOS auto-zoom while keeping sizes consistent (see apps/web/src/components/ui/input.tsx:35-37). Using arbitrary sizes (text-[16px] sm:text-[14px]) here works but makes the sizing less consistent/maintainable; consider switching to the semantic utilities for the editor and placeholder as well.

Copilot uses AI. Check for mistakes.
@github-actions github-actions bot added size:S 10-29 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Mar 22, 2026
@murataslan1 murataslan1 force-pushed the fix/mobile-input-zoom branch from a1617aa to 47f5a8f Compare March 22, 2026 00:11
@github-actions github-actions bot added size:XS 0-9 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Focusing the chat input zooms the app in causing weird scroll on mobile

2 participants