0
Fork 0
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:
Joe Woods 2023-01-30 23:50:29 +00:00 committed by Neil Jenkins
parent fe0dfdf6c4
commit 00e3482815

View file

@ -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;