uiwjs / react-markdown-editor

A markdown editor with preview, implemented with React.js and TypeScript.
https://uiwjs.github.io/react-markdown-editor
MIT License
327 stars 32 forks source link

How to spread preview on the whole width (not the half of editor) #192

Closed lofti198 closed 2 years ago

lofti198 commented 2 years ago

How to spread preview on the whole width (not the half of editor) by default? image

Thank you in advance!

jaywcjlove commented 2 years ago

@lofti198 Upgrade v5.7.0

import MarkdownEditor from '@uiw/react-markdown-editor';

const Dome = () => (
  <MarkdownEditor
+    previewWidth="100%"
  />
);
lofti198 commented 2 years ago

Cool! Works awesome, however found strange behavior: <MarkdownEditor previewWidth="100%" ref={editorRef} style={{ height: "200px", overflow: "scroll", padding: "8px", }} extensions={[EditorView.lineWrapping]} value={markdown} onChange={(value, viewUpdate) => { setMarkdown(value); }} onBlur={(e) => handleDefocus(e)} />

image