Skip to content

Commit 640c5e4

Browse files
Do not render simulator when collapsed
Removes extra space on the right of HTML when the simulator is closed
1 parent 70ba3ee commit 640c5e4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/App.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ body,
4242
width: 100%;
4343
height: 100%;
4444
}
45-
html, body {
45+
body {
4646
overflow: hidden;
4747
}

src/simulator/Simulator.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ const Simulator = ({
8989
}
9090
}, [previouslyShown, showSimulatorButtonRef, shown, simFocus]);
9191

92+
if (!shown) {
93+
return null;
94+
}
95+
9296
return (
9397
<DeviceContextProvider value={simulator.current}>
9498
<Flex

0 commit comments

Comments
 (0)