@@ -149,7 +149,7 @@ class MonacoEditor extends React.Component<Props, State> implements Editor {
149149 this . typingsFetcherWorker = null ;
150150 this . sizeProbeInterval = null ;
151151
152- this . resizeEditor = debounce ( this . resizeEditor , 500 ) ;
152+ this . resizeEditor = debounce ( this . resizeEditor , 150 ) ;
153153 this . commitLibChanges = debounce ( this . commitLibChanges , 300 ) ;
154154 this . onSelectionChangedDebounced = debounce (
155155 this . onSelectionChangedDebounced ,
@@ -167,6 +167,15 @@ class MonacoEditor extends React.Component<Props, State> implements Editor {
167167 this . resizeEditorInstantly ( ) ;
168168 }
169169
170+ if (
171+ this . props . absoluteWidth &&
172+ this . props . absoluteHeight &&
173+ ( this . props . absoluteWidth !== nextProps . absoluteWidth ||
174+ this . props . absoluteHeight !== nextProps . absoluteHeight )
175+ ) {
176+ this . resizeEditor ( ) ;
177+ }
178+
170179 if ( this . props . readOnly !== nextProps . readOnly && this . editor ) {
171180 this . editor . updateOptions ( { readOnly : ! ! nextProps . readOnly } ) ;
172181 }
@@ -256,10 +265,13 @@ class MonacoEditor extends React.Component<Props, State> implements Editor {
256265 // this.addKeyCommands();
257266
258267 window . addEventListener ( 'resize' , this . resizeEditor ) ;
259- this . sizeProbeInterval = setInterval (
260- this . resizeEditorInstantly . bind ( this ) ,
261- 3000
262- ) ;
268+ this . sizeProbeInterval = setInterval ( ( ) => {
269+ if ( this . props . absoluteWidth && this . props . absoluteHeight ) {
270+ return ;
271+ }
272+
273+ this . resizeEditorInstantly ( ) ;
274+ } , 3000 ) ;
263275
264276 const { dependencies } = this ;
265277 if ( dependencies != null ) {
0 commit comments