mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
value attribute of Editor must be set after mounting
This commit is contained in:
@@ -95,6 +95,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
let { mode, value } = this.props
|
let { mode, value } = this.props
|
||||||
|
this.value = value
|
||||||
let el = ReactDOM.findDOMNode(this)
|
let el = ReactDOM.findDOMNode(this)
|
||||||
let editor = this.editor = ace.edit(el)
|
let editor = this.editor = ace.edit(el)
|
||||||
editor.$blockScrolling = Infinity
|
editor.$blockScrolling = Infinity
|
||||||
|
|||||||
@@ -7,12 +7,16 @@ import MarkdownPreview from 'browser/components/MarkdownPreview'
|
|||||||
class MarkdownEditor extends React.Component {
|
class MarkdownEditor extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
status: 'CODE'
|
status: 'CODE'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidMount () {
|
||||||
|
this.value = this.refs.code.value
|
||||||
|
}
|
||||||
|
|
||||||
handleChange (e) {
|
handleChange (e) {
|
||||||
this.value = this.refs.code.value
|
this.value = this.refs.code.value
|
||||||
this.props.onChange(e)
|
this.props.onChange(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user