We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 40c3e2a commit 1dbc1ccCopy full SHA for 1dbc1cc
packages/utils/src/dom.ts
@@ -1,8 +1,5 @@
1
export const removeAllSelection = () => {
2
- const selection = window.getSelection();
3
- for (let i = 0; i < selection.rangeCount; i++) {
4
- selection.removeRange(selection.getRangeAt(i));
5
- }
+ window.getSelection()?.removeAllRanges();
6
};
7
8
export const syncScroll = (left: HTMLElement, right: HTMLElement) => {
0 commit comments