diff --git a/docs/app/layout.tsx b/docs/app/layout.tsx index 0309bc3fbd..13c1d10790 100644 --- a/docs/app/layout.tsx +++ b/docs/app/layout.tsx @@ -2,7 +2,7 @@ import { Footer } from "@/components/Footer"; import { Provider } from "@/components/provider"; import { getFullMetadata } from "@/lib/getFullMetadata"; import { Analytics } from "@vercel/analytics/next"; -import { Metadata } from "next"; +import { Metadata, Viewport } from "next"; import "./global.css"; import "./gradients.css"; import "./styles.css"; @@ -13,14 +13,27 @@ export const metadata: Metadata = getFullMetadata({ "A beautiful text editor that just works. Easily add an editor to your app that users will love. Customize it with your own functionality like custom blocks or AI tooling.", }); +// Resizes the layout viewport (not just the visual viewport) when a virtual +// keyboard opens, so `position: fixed` elements can be pinned to the top of the +// keyboard. Must be set in the initial HTML, so it lives here rather than in an +// example's App. Mirrors the examples' generated `index.html` viewport meta. +export const viewport: Viewport = { + width: "device-width", + initialScale: 1, + interactiveWidget: "resizes-content", +}; + export default function Layout({ children }: LayoutProps<"/">) { return ( - - {children} -