From f83db9ef7ae1cb5e73df485548356e87b7dfdfd5 Mon Sep 17 00:00:00 2001 From: sloemo01 Date: Mon, 12 Oct 2026 22:05:23 +0530 Subject: [PATCH] Stop a scaled mobile preview clipping at 208px The restricted-size wrapper pinned the frame to a fixed 208px (w-52), so a mobile preview scaled wider than that lost its right edge. Use minWidth of max(scaledWidth, 208) so the frame keeps the 208px floor while the preview keeps its full width. The scrollbar CSS injected on mobile devices now zeroes the scrollbar boxes rather than only hiding them; the leftover space shifted the layout viewport and made the clipping worse. Fixes #1515. --- .../components/Previewer/Device/DeviceFrame.tsx | 7 ++++--- .../Previewer/Device/useWebviewLifecycle.ts | 14 +++++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/desktop-app/src/renderer/components/Previewer/Device/DeviceFrame.tsx b/desktop-app/src/renderer/components/Previewer/Device/DeviceFrame.tsx index fb3da3c1d..1b43299ff 100644 --- a/desktop-app/src/renderer/components/Previewer/Device/DeviceFrame.tsx +++ b/desktop-app/src/renderer/components/Previewer/Device/DeviceFrame.tsx @@ -218,9 +218,10 @@ const DeviceFrame = ({ return (
{/* The label row is also the canvas drag handle, so it stays in the tree even when name and dims are toggled off. */} diff --git a/desktop-app/src/renderer/components/Previewer/Device/useWebviewLifecycle.ts b/desktop-app/src/renderer/components/Previewer/Device/useWebviewLifecycle.ts index 5768782a0..f0689f150 100644 --- a/desktop-app/src/renderer/components/Previewer/Device/useWebviewLifecycle.ts +++ b/desktop-app/src/renderer/components/Previewer/Device/useWebviewLifecycle.ts @@ -27,10 +27,18 @@ const useWebviewLifecycle = ( return undefined; } const hideScrollbars = () => { + // Zero-size scrollbars keep the layout viewport steady; hiding them + // without taking the space still shifted a scaled mobile preview. webview.insertCSS(` - ::-webkit-scrollbar { - display: none; - } `); + html, body { + scrollbar-width: none; + } + ::-webkit-scrollbar { + width: 0px !important; + height: 0px !important; + display: none !important; + } + `); }; webview.addEventListener('dom-ready', hideScrollbars); return () => {