Fix scrolling + codemirror render

This commit is contained in:
Jori Lallo
2016-06-03 01:01:01 -07:00
parent 6206acfad0
commit 1345f9629d
4 changed files with 11 additions and 8 deletions

View File

@@ -43,9 +43,7 @@ class DocumentEdit extends Component {
}
onPreviewToggle = () => {
// Force re-render to fix issues with
// Codemirror cursor (gets out of sync)
state.togglePreview(this.forceUpdate());
state.togglePreview();
}
render() {
@@ -94,6 +92,7 @@ class DocumentEdit extends Component {
onChange={ state.updateText }
text={ state.text }
replaceText={ state.replaceText }
preview={ state.preview }
/>
</EditorPane>
{ state.preview ? (