0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 15:23:29 -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 { } else {
const selection = window.getSelection(); const selection = window.getSelection();
if (selection) { if (selection) {
selection.setBaseAndExtent( if ('setBaseAndExtent' in Selection.prototype) {
range.startContainer, selection.setBaseAndExtent(
range.startOffset, range.startContainer,
range.endContainer, range.startOffset,
range.endOffset, range.endContainer,
); range.endOffset,
);
} else {
selection.removeAllRanges();
selection.addRange(range);
}
} }
} }
return this; return this;