Skip to content

Commit dbfd25b

Browse files
committed
value attribute of Editor must be set after mounting
1 parent 4292583 commit dbfd25b

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

browser/components/CodeEditor.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export default class CodeEditor extends React.Component {
9595

9696
componentDidMount () {
9797
let { mode, value } = this.props
98+
this.value = value
9899
let el = ReactDOM.findDOMNode(this)
99100
let editor = this.editor = ace.edit(el)
100101
editor.$blockScrolling = Infinity

browser/components/MarkdownEditor.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ import MarkdownPreview from 'browser/components/MarkdownPreview'
77
class MarkdownEditor extends React.Component {
88
constructor (props) {
99
super(props)
10-
10+
1111
this.state = {
1212
status: 'CODE'
1313
}
1414
}
1515

16+
componentDidMount () {
17+
this.value = this.refs.code.value
18+
}
19+
1620
handleChange (e) {
1721
this.value = this.refs.code.value
1822
this.props.onChange(e)

0 commit comments

Comments
 (0)