1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

focus content editor after create new Note

This commit is contained in:
Dick Choi
2016-06-12 19:55:39 +09:00
parent eb1a0ba49f
commit ce915df2b2
7 changed files with 65 additions and 7 deletions

View File

@@ -42,6 +42,18 @@ class MarkdownEditor extends React.Component {
})
}
focus () {
if (this.state.status === 'PREVIEW') {
this.setState({
status: 'CODE'
}, () => {
this.refs.code.focus()
})
} else {
this.refs.code.focus()
}
}
reload () {
this.refs.code.reload()
}