Skip to content

Commit

Permalink
Merge pull request #820 from asmsuechan/drag-drop-image-caret-ubuntu
Browse files Browse the repository at this point in the history
Fix image insesration problem
  • Loading branch information
asmsuechan committed Aug 20, 2017
2 parents acba61f + d88dd26 commit eb2994e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion browser/components/CodeEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export default class CodeEditor extends React.Component {
insertImageMd (imageMd) {
const textarea = this.editor.getInputField()
const cm = this.editor
textarea.value = `${textarea.value.substr(0, textarea.selectionStart)}${imageMd}${textarea.value.substr(textarea.selectionEnd)}`
cm.replaceSelection(`${textarea.value.substr(0, textarea.selectionStart)}${imageMd}${textarea.value.substr(textarea.selectionEnd)}`)
}

render () {
Expand Down

0 comments on commit eb2994e

Please sign in to comment.