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 = () => {
81
81
const [ consoleSize , setConsoleSize ] = useState ( 150 ) ;
82
82
const [ sidebarSize , setSidebarSize ] = useState ( 160 ) ;
83
83
const [ isOverlayVisible , setIsOverlayVisible ] = useState ( true ) ;
84
-
84
+ const [ , setMaxSize ] = useState ( ) ;
85
85
const cmRef = useRef ( { } ) ;
86
86
87
87
const autosaveIntervalRef = useRef ( null ) ;
@@ -127,6 +127,17 @@ const IDEView = () => {
127
127
}
128
128
} ;
129
129
} , [ 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 ] ) ;
130
141
131
142
return (
132
143
< RootPage >
@@ -155,6 +166,7 @@ const IDEView = () => {
155
166
< Sidebar />
156
167
< SplitPane
157
168
split = "vertical"
169
+ maxSize = { window . innerWidth * 0.965 }
158
170
defaultSize = "50%"
159
171
onChange = { ( ) => {
160
172
setIsOverlayVisible ( true ) ;
You can’t perform that action at this time.
0 commit comments