File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ const IDEView = () => {
102
102
const [ consoleSize , setConsoleSize ] = useState ( 150 ) ;
103
103
const [ sidebarSize , setSidebarSize ] = useState ( 160 ) ;
104
104
const [ isOverlayVisible , setIsOverlayVisible ] = useState ( false ) ;
105
+ const [ MaxSize , setMaxSize ] = useState ( window . innerWidth ) ;
105
106
106
107
const cmRef = useRef ( { } ) ;
107
108
@@ -146,6 +147,17 @@ const IDEView = () => {
146
147
}
147
148
} ;
148
149
} , [ shouldAutosave , dispatch ] ) ;
150
+ useEffect ( ( ) => {
151
+ const updateInnerWidth = ( e ) => {
152
+ setMaxSize ( e . target . innerWidth ) ;
153
+ } ;
154
+
155
+ window . addEventListener ( 'resize' , updateInnerWidth ) ;
156
+
157
+ return ( ) => {
158
+ window . removeEventListener ( 'resize' , updateInnerWidth ) ;
159
+ } ;
160
+ } , [ setMaxSize ] ) ;
149
161
150
162
const consoleCollapsedSize = 29 ;
151
163
const currentConsoleSize = ide . consoleIsExpanded
@@ -179,6 +191,7 @@ const IDEView = () => {
179
191
< Sidebar />
180
192
< SplitPane
181
193
split = "vertical"
194
+ maxSize = { MaxSize * 0.965 }
182
195
defaultSize = "50%"
183
196
onChange = { ( ) => {
184
197
setIsOverlayVisible ( true ) ;
You can’t perform that action at this time.
0 commit comments