@@ -82,7 +82,7 @@ const IDEView = () => {
82
82
const [ consoleSize , setConsoleSize ] = useState ( 150 ) ;
83
83
const [ sidebarSize , setSidebarSize ] = useState ( 160 ) ;
84
84
const [ isOverlayVisible , setIsOverlayVisible ] = useState ( false ) ;
85
- const [ , setMaxSize ] = useState ( ) ;
85
+ const [ MaxSize , setMaxSize ] = useState ( window . innerWidth ) ;
86
86
87
87
const cmRef = useRef ( { } ) ;
88
88
@@ -128,16 +128,16 @@ const IDEView = () => {
128
128
} ;
129
129
} , [ shouldAutosave , dispatch ] ) ;
130
130
useEffect ( ( ) => {
131
- const updateInnerWidth = ( ) => {
132
- setMaxSize ( window . innerWidth ) ;
131
+ const updateInnerWidth = ( e ) => {
132
+ setMaxSize ( e . target . innerWidth ) ;
133
133
} ;
134
134
135
135
window . addEventListener ( 'resize' , updateInnerWidth ) ;
136
136
137
137
return ( ) => {
138
138
window . removeEventListener ( 'resize' , updateInnerWidth ) ;
139
139
} ;
140
- } , [ window . innerWidth ] ) ;
140
+ } , [ setMaxSize ] ) ;
141
141
142
142
return (
143
143
< RootPage >
@@ -166,7 +166,7 @@ const IDEView = () => {
166
166
< Sidebar />
167
167
< SplitPane
168
168
split = "vertical"
169
- maxSize = { window . innerWidth * 0.965 }
169
+ maxSize = { MaxSize * 0.965 }
170
170
defaultSize = "50%"
171
171
onChange = { ( ) => {
172
172
setIsOverlayVisible ( true ) ;
0 commit comments