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 () => {