fix(web): prevent iOS auto-zoom on chat input focus#1292
fix(web): prevent iOS auto-zoom on chat input focus#1292murataslan1 wants to merge 1 commit intopingdotgg:mainfrom
Conversation
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
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment 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 |
There was a problem hiding this comment.
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 (
smbreakpoint and below) while keeping 14px onsm+. - Update
index.htmlviewport meta tag to includemaximum-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" /> |
There was a problem hiding this comment.
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.
| <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" /> |
| @@ -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"> | |||
There was a problem hiding this comment.
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.
a1617aa to
47f5a8f
Compare
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-sizebelow 16px. The composer editor (ComposerPromptEditor.tsx) usedtext-[14px], which triggers this behavior on mobile devices.Fix
font-sizeto16pxon mobile viewports,14pxonsm+(matching placeholder)maximum-scale=1to the viewport meta tag to prevent auto-zoom on all inputsTest plan
Fixes #1265
Note
Prevent iOS auto-zoom on chat input focus
font-sizeto 16px (iOS's zoom threshold) on the chat input inComposerPromptEditor.tsx, reverting to 14px at thesmbreakpoint and above.maximum-scale=1.0to the viewport meta tag inindex.htmlas a secondary safeguard.maximum-scale=1.0disables user-initiated pinch-to-zoom on all browsers that respect it.Macroscope summarized 47f5a8f.