Skip to content
This repository was archived by the owner on Nov 4, 2019. It is now read-only.

Commit 84c0dc3

Browse files
committed
Prevent cursor lost position on updates.
1 parent cb48b74 commit 84c0dc3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

addon/components/medium-editor.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ const MediumEditorComponent = Component.extend({
105105
_setContent(_editor = null) {
106106
let editor = _editor || get(this, '_editor');
107107
if (isPresent(editor)) {
108+
editor.saveSelection();
108109
editor.setContent(get(this, 'value'));
110+
editor.restoreSelection();
109111
}
110112
},
111113

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ember-medium-editor",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "medium-editor for Ember Apps",
55
"keywords": [
66
"medium-editor",

0 commit comments

Comments
 (0)