1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 02:06:29 +00:00

Fix prevention of an image dropped on MarkdownPreview and fix the behavior of an image dropped on CodeEditor

This commit is contained in:
asmsuechan
2017-02-21 00:14:03 +09:00
parent 8beb661af4
commit 4bb9533049
2 changed files with 11 additions and 2 deletions

View File

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