-
Notifications
You must be signed in to change notification settings - Fork 257
Open
Description
Hi,
I'm facing a strange issue, I suppose I did something wrong.
When I type a character, I lost the focus on the editor. Moreover, the autoFocus option did work so I need to click inside the editor before typing.
What have I missed ?
I'm using react-codemirror 1.0.0
import React from 'react'
import ReactMarkdown from 'react-markdown'
import CodeMirror from 'react-codemirror'
import 'codemirror/mode/markdown/markdown'
export default class TopicContentComponent extends React.Component {
constructor(props) {
super(props);
this.state = {
source: props.source,
}
}
render () {
const options = {
lineNumbers: true,
autoFocus: true,
mode: 'markdown',
theme: 'monokai',
}
const Preview = () => <ReactMarkdown source={this.state.source} />
const Editor = () =>
<CodeMirror
value={this.state.source}
onChange={(source) => this.setState({source})}
options={options}
/>
return (
<div>
<Preview />
<Editor />
</div>
)
}
}
Thank you
marabesi
Metadata
Metadata
Assignees
Labels
No labels