File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments