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:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user