@@ -82,7 +82,7 @@ const IDEView = () => {
8282 const [ consoleSize , setConsoleSize ] = useState ( 150 ) ;
8383 const [ sidebarSize , setSidebarSize ] = useState ( 160 ) ;
8484 const [ isOverlayVisible , setIsOverlayVisible ] = useState ( false ) ;
85- const [ , setMaxSize ] = useState ( ) ;
85+ const [ MaxSize , setMaxSize ] = useState ( window . innerWidth ) ;
8686
8787 const cmRef = useRef ( { } ) ;
8888
@@ -128,16 +128,16 @@ const IDEView = () => {
128128 } ;
129129 } , [ shouldAutosave , dispatch ] ) ;
130130 useEffect ( ( ) => {
131- const updateInnerWidth = ( ) => {
132- setMaxSize ( window . innerWidth ) ;
131+ const updateInnerWidth = ( e ) => {
132+ setMaxSize ( e . target . innerWidth ) ;
133133 } ;
134134
135135 window . addEventListener ( 'resize' , updateInnerWidth ) ;
136136
137137 return ( ) => {
138138 window . removeEventListener ( 'resize' , updateInnerWidth ) ;
139139 } ;
140- } , [ window . innerWidth ] ) ;
140+ } , [ setMaxSize ] ) ;
141141
142142 return (
143143 < RootPage >
@@ -166,7 +166,7 @@ const IDEView = () => {
166166 < Sidebar />
167167 < SplitPane
168168 split = "vertical"
169- maxSize = { window . innerWidth * 0.965 }
169+ maxSize = { MaxSize * 0.965 }
170170 defaultSize = "50%"
171171 onChange = { ( ) => {
172172 setIsOverlayVisible ( true ) ;
0 commit comments