We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 17ac5e9 commit 87fd545Copy full SHA for 87fd545
src/common/url.js
@@ -9,5 +9,13 @@ export const getSandboxOptions = () => {
9
result.isPreviewScreen = location.search.includes('view=preview');
10
result.isEditorScreen = location.search.includes('view=editor');
11
12
+ // If there is no view specified and the width of the window is <800 we want
13
+ // to default to preview
14
+ if (!result.isPreviewScreen && !result.isEditorScreen) {
15
+ const windowWidth =
16
+ window.innerWidth || document.documentElement.clientWidth;
17
+ result.isPreviewScreen = windowWidth < 800;
18
+ }
19
+
20
return result;
21
};
0 commit comments