Skip to content

Commit

Permalink
fixes #722
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed Jun 3, 2016
1 parent 74fc8bb commit 6e9abd6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/quill.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,13 @@ class Quill {
this.editor.applyDelta(delta);
}

setSelection(index, length = 0, source = Emitter.sources.API) {
[index, length, , source] = overload(index, length, source);
this.selection.setRange(new Range(index, length), source);
setSelection(index, length, source) {
if (index == null) {
this.selection.setRange(null, length || Quill.sources.API);
} else {
[index, length, , source] = overload(index, length, source);
this.selection.setRange(new Range(index, length), source);
}
this.selection.scrollIntoView();
}

Expand Down

0 comments on commit 6e9abd6

Please sign in to comment.