Skip to content

Commit a9e20a5

Browse files
committed
Remove infinite viewportMargin
1 parent 2b6d058 commit a9e20a5

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/components/write/WriteMarkdownEditor.tsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ type MarkdownEditorState = {
4444

4545
const MarkdownEditorBlock = styled.div`
4646
height: 100%;
47+
display: flex;
48+
flex-direction: column;
4749
overflow-y: auto;
4850
position: relative;
4951
&::-webkit-scrollbar {
@@ -63,10 +65,13 @@ const MarkdownEditorBlock = styled.div`
6365
6466
& > .wrapper {
6567
padding-top: 3rem;
66-
padding-bottom: 10rem;
68+
padding-bottom: 4rem;
69+
flex: 1;
70+
display: flex;
71+
flex-direction: column;
6772
}
6873
.CodeMirror {
69-
height: auto;
74+
flex: 1;
7075
font-size: 1.125rem;
7176
line-height: 1.5;
7277
color: ${palette.gray8};
@@ -115,6 +120,12 @@ const PaddingWrapper = styled.div`
115120
padding-right: 3rem;
116121
`;
117122

123+
const MarkdownWrapper = styled.div`
124+
flex: 1;
125+
display: flex;
126+
flex-direction: column;
127+
`;
128+
118129
const FooterWrapper = styled.div`
119130
position: fixed;
120131
bottom: 0;
@@ -193,7 +204,7 @@ export default class WriteMarkdownEditor extends React.Component<
193204
mode: 'markdown',
194205
theme: 'one-light',
195206
placeholder: '당신의 이야기를 적어보세요...',
196-
viewportMargin: Infinity,
207+
// viewportMargin: Infinity,
197208
lineWrapping: true,
198209
});
199210

@@ -746,7 +757,7 @@ ${selected}
746757
onConvert={this.handleAskConvert}
747758
innerRef={this.toolbarElement}
748759
/>
749-
<PaddingWrapper>
760+
<MarkdownWrapper>
750761
{addLink.visible && (
751762
<AddLink
752763
defaultValue=""
@@ -758,7 +769,7 @@ ${selected}
758769
/>
759770
)}
760771
<textarea ref={this.editorElement} style={{ display: 'none' }} />
761-
</PaddingWrapper>
772+
</MarkdownWrapper>
762773
</div>
763774
<AskChangeEditor
764775
visible={this.state.askChangeEditor}

0 commit comments

Comments
 (0)