Skip to content

Commit cd0543f

Browse files
committed
Adjust to Coker's new suggestions
1 parent 4b7c712 commit cd0543f

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -644,10 +644,11 @@ class CodeEditor extends React.Component<CodeEditorProps, CodeEditorState> {
644644

645645
const editor = (
646646
<div
647-
className={css(styles.codeEditorCode, isFullHeight && styles.modifiers.fullHeight)}
647+
className={css(styles.codeEditorCode)}
648648
ref={this.wrapperRef}
649649
tabIndex={0}
650650
dir="ltr"
651+
style={{ height: '100%' }}
651652
>
652653
<Editor
653654
height={height === '100%' ? undefined : height}
@@ -666,13 +667,13 @@ class CodeEditor extends React.Component<CodeEditorProps, CodeEditorState> {
666667

667668
return (
668669
<div
669-
className={css(
670-
styles.codeEditor,
671-
isReadOnly && styles.modifiers.readOnly,
672-
isFullHeight && styles.modifiers.fullHeight,
673-
className
674-
)}
670+
className={css(styles.codeEditor, isReadOnly && styles.modifiers.readOnly, className)}
675671
ref={this.ref}
672+
style={
673+
isFullHeight
674+
? { height: '100%', display: 'flex', flexDirection: 'column' }
675+
: { display: 'flex', flexDirection: 'column' }
676+
}
676677
>
677678
{isUploadEnabled || providedEmptyState ? (
678679
<div
@@ -683,11 +684,8 @@ class CodeEditor extends React.Component<CodeEditorProps, CodeEditorState> {
683684
>
684685
{editorHeader}
685686
<div
686-
className={css(
687-
styles.codeEditorMain,
688-
isDragActive && styles.modifiers.dragHover,
689-
isFullHeight && styles.modifiers.fullHeight
690-
)}
687+
className={css(styles.codeEditorMain, isDragActive && styles.modifiers.dragHover)}
688+
style={{ flexGrow: 1 }}
691689
>
692690
<div className={css(styles.codeEditorUpload)}>
693691
<input {...getInputProps()} /* hidden, necessary for react-dropzone */ />
@@ -699,7 +697,7 @@ class CodeEditor extends React.Component<CodeEditorProps, CodeEditorState> {
699697
<>
700698
{editorHeader}
701699
{showEditor && (
702-
<div className={css(styles.codeEditorMain, isFullHeight && styles.modifiers.fullHeight)}>
700+
<div className={css(styles.codeEditorMain)} style={{ flexGrow: 1 }}>
703701
{editor}
704702
</div>
705703
)}

0 commit comments

Comments
 (0)