Skip to content

Commit 1dbc1cc

Browse files
committed
fix(utils): use native removeAllRanges() to fix WebKit NotFoundError
Closes #56
1 parent 40c3e2a commit 1dbc1cc

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

packages/utils/src/dom.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
export const removeAllSelection = () => {
2-
const selection = window.getSelection();
3-
for (let i = 0; i < selection.rangeCount; i++) {
4-
selection.removeRange(selection.getRangeAt(i));
5-
}
2+
window.getSelection()?.removeAllRanges();
63
};
74

85
export const syncScroll = (left: HTMLElement, right: HTMLElement) => {

0 commit comments

Comments
 (0)