mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
Add secondary path if setBaseAndExtent undefined
This commit is contained in:
parent
fe0dfdf6c4
commit
00e3482815
1 changed files with 11 additions and 6 deletions
|
@ -639,12 +639,17 @@ class Squire {
|
|||
} else {
|
||||
const selection = window.getSelection();
|
||||
if (selection) {
|
||||
if ('setBaseAndExtent' in Selection.prototype) {
|
||||
selection.setBaseAndExtent(
|
||||
range.startContainer,
|
||||
range.startOffset,
|
||||
range.endContainer,
|
||||
range.endOffset,
|
||||
);
|
||||
} else {
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
|
|
Loading…
Reference in a new issue