Skip to content

Commit c06dbde

Browse files
authored
fix(CodeEditor): ensure that handleResize works when viewport shrinks (#11532)
1 parent 86ff923 commit c06dbde

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/react-code-editor/src/components/CodeEditor/CodeEditor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ class CodeEditor extends React.Component<CodeEditorProps, CodeEditorState> {
364364

365365
handleResize = () => {
366366
if (this.editor) {
367+
this.editor.layout({ width: 0, height: 0 }); // ensures the editor won't take up more space than it needs
367368
this.editor.layout();
368369
}
369370
};

0 commit comments

Comments
 (0)