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 = () => {
102102 const [ consoleSize , setConsoleSize ] = useState ( 150 ) ;
103103 const [ sidebarSize , setSidebarSize ] = useState ( 160 ) ;
104104 const [ isOverlayVisible , setIsOverlayVisible ] = useState ( false ) ;
105+ const [ MaxSize , setMaxSize ] = useState ( window . innerWidth ) ;
105106
106107 const cmRef = useRef ( { } ) ;
107108
@@ -146,6 +147,17 @@ const IDEView = () => {
146147 }
147148 } ;
148149 } , [ 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 ] ) ;
149161
150162 const consoleCollapsedSize = 29 ;
151163 const currentConsoleSize = ide . consoleIsExpanded
@@ -179,6 +191,7 @@ const IDEView = () => {
179191 < Sidebar />
180192 < SplitPane
181193 split = "vertical"
194+ maxSize = { MaxSize * 0.965 }
182195 defaultSize = "50%"
183196 onChange = { ( ) => {
184197 setIsOverlayVisible ( true ) ;
You can’t perform that action at this time.
0 commit comments