From 9c67809eb2a85cb059f758c952befc16513de759 Mon Sep 17 00:00:00 2001 From: James Haworth Date: Mon, 9 Jun 2025 21:32:34 +0100 Subject: [PATCH] fix(mobile): prevent viewport zoom on input focus on iOS On iOS devices, the browser automatically zooms in on text inputs, which can disrupt the user experience by leaving the viewport zoomed in after an action is completed. This change resolves the issue by setting `maximum-scale=1` in the viewport configuration, preventing both automatic and manual scaling and ensuring the chat interface remains fully visible after sending a message. Fixes #21 --- app/layout.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/layout.tsx b/app/layout.tsx index 82e9608..20c4b60 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,4 +1,4 @@ -import type { Metadata } from 'next'; +import type { Metadata, Viewport } from 'next'; import { Geist, Geist_Mono } from 'next/font/google'; import './globals.css'; import 'katex/dist/katex.min.css'; @@ -21,6 +21,10 @@ export const metadata: Metadata = { description: 'Fastest AI Chat App', }; +export const viewport: Viewport = { + maximumScale: 1, +}; + export default function RootLayout({ children, }: Readonly<{