We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 038fe90 + 1dbc1cc commit c947b06Copy full SHA for c947b06
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