Fixing selection bug

This commit is contained in:
Alex Yatskov 2016-04-24 11:31:55 -07:00
parent 7f661fdd81
commit b421b435fa
2 changed files with 1 additions and 4 deletions

View File

@ -118,10 +118,6 @@ class Client {
this.popup.showNextTo(range.getRect(), content); this.popup.showNextTo(range.getRect(), content);
if (this.options.highlightText) { if (this.options.highlightText) {
if (this.lastRange !== null) {
this.lastRange.deselect();
}
range.select(); range.select();
} }

View File

@ -62,6 +62,7 @@ class Range {
select() { select() {
const selection = window.getSelection(); const selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(this.rng); selection.addRange(this.rng);
} }