File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
src/Rin.Frontend/src/components/inspector Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -203,14 +203,12 @@ function EditorPreview(props: {
203
203
204
204
useEffect ( ( ) => {
205
205
const listener = ( ) => {
206
- editor ?. layout ( { width : 0 , height : 0 } ) ;
207
206
editor ?. layout ( ) ;
208
207
} ;
209
208
210
209
window . addEventListener ( 'resize' , listener ) ;
211
210
212
211
// force re-layout
213
- editor ?. layout ( { width : 0 , height : 0 } ) ;
214
212
editor ?. layout ( ) ;
215
213
216
214
return ( ) => window . removeEventListener ( 'resize' , listener ) ;
@@ -223,15 +221,17 @@ function EditorPreview(props: {
223
221
} ;
224
222
225
223
return (
226
- < MonacoEditor
227
- width = "100%"
228
- height = "100%"
229
- options = { monacoOptions }
230
- theme = { props . theme ?? 'vs' }
231
- language = { props . language ?? getMonacoLanguage ( props . contentType ) }
232
- value = { props . body }
233
- editorDidMount = { ( editor ) => setEditor ( editor ) }
234
- />
224
+ < div style = { { width : '100%' , height : '100%' , overflow : 'hidden' } } >
225
+ < MonacoEditor
226
+ width = "100%"
227
+ height = "100%"
228
+ options = { monacoOptions }
229
+ theme = { props . theme ?? 'vs' }
230
+ language = { props . language ?? getMonacoLanguage ( props . contentType ) }
231
+ value = { props . body }
232
+ editorDidMount = { ( editor ) => setEditor ( editor ) }
233
+ />
234
+ </ div >
235
235
) ;
236
236
}
237
237
You can’t perform that action at this time.
0 commit comments