Skip to content

Commit c7cfd67

Browse files
committed
line sorted
1 parent ca74574 commit c7cfd67

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

client/modules/IDE/pages/IDEView.jsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const IDEView = () => {
8181
const [consoleSize, setConsoleSize] = useState(150);
8282
const [sidebarSize, setSidebarSize] = useState(160);
8383
const [isOverlayVisible, setIsOverlayVisible] = useState(true);
84-
84+
const [, setMaxSize] = useState();
8585
const cmRef = useRef({});
8686

8787
const autosaveIntervalRef = useRef(null);
@@ -127,6 +127,17 @@ const IDEView = () => {
127127
}
128128
};
129129
}, [shouldAutosave, dispatch]);
130+
useEffect(() => {
131+
const updateInnerWidth = () => {
132+
setMaxSize(window.innerWidth);
133+
};
134+
135+
window.addEventListener('resize', updateInnerWidth);
136+
137+
return () => {
138+
window.removeEventListener('resize', updateInnerWidth);
139+
};
140+
}, [window.innerWidth]);
130141

131142
return (
132143
<RootPage>
@@ -155,6 +166,7 @@ const IDEView = () => {
155166
<Sidebar />
156167
<SplitPane
157168
split="vertical"
169+
maxSize={window.innerWidth * 0.965}
158170
defaultSize="50%"
159171
onChange={() => {
160172
setIsOverlayVisible(true);

0 commit comments

Comments
 (0)