1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Fix inseration position

This commit is contained in:
asmsuechan
2017-07-22 16:05:14 +09:00
parent b35395e6bd
commit 7002026190

View File

@@ -199,8 +199,9 @@ export default class CodeEditor extends React.Component {
}
insertImageMd (imageMd) {
const textarea = this.editor.getInputField()
const cm = this.editor
cm.setValue(cm.getValue() + imageMd)
textarea.value = `${textarea.value.substr(0, textarea.selectionStart)}${imageMd}${textarea.value.substr(textarea.selectionEnd)}`
}
render () {