From b421b435fad14f1cf4f644a8e64e1d2e5c6184cd Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 24 Apr 2016 11:31:55 -0700 Subject: Fixing selection bug --- ext/fg/js/client.js | 4 ---- ext/fg/js/range.js | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'ext/fg/js') diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js index bc389818..44a3b84c 100644 --- a/ext/fg/js/client.js +++ b/ext/fg/js/client.js @@ -118,10 +118,6 @@ class Client { this.popup.showNextTo(range.getRect(), content); if (this.options.highlightText) { - if (this.lastRange !== null) { - this.lastRange.deselect(); - } - range.select(); } diff --git a/ext/fg/js/range.js b/ext/fg/js/range.js index 9a98fb1a..1d6b4e0e 100644 --- a/ext/fg/js/range.js +++ b/ext/fg/js/range.js @@ -62,6 +62,7 @@ class Range { select() { const selection = window.getSelection(); + selection.removeAllRanges(); selection.addRange(this.rng); } -- cgit v1.2.3