Fixing selection bug
This commit is contained in:
parent
7f661fdd81
commit
b421b435fa
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user