Skip to content

Commit e4e15d3

Browse files
fix(CodeEditor): Adjust sizeToFit height bug (#12529)
* fix(CodeEditor): Adjust sizeToFit height bug * Address feedback
1 parent 4cc476a commit e4e15d3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,9 @@ export const CodeEditor = ({
385385
onEditorDidMount(editor, monaco);
386386
editorRef.current = editor;
387387
if (height === 'sizeToFit') {
388-
setHeightToFitContent();
388+
editor.onDidContentSizeChange(() => {
389+
setHeightToFitContent();
390+
});
389391
}
390392
};
391393

0 commit comments

Comments
 (0)