From 1dbdaf93d79e58366eb0389a5052476dadfcbf43 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Mon, 22 Feb 2021 02:22:17 -0500 Subject: [PATCH] caretPosition: Delete no-op `Range.detach()` call --- src/static/js/caretPosition.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/static/js/caretPosition.js b/src/static/js/caretPosition.js index 1610219de..2b80b9879 100644 --- a/src/static/js/caretPosition.js +++ b/src/static/js/caretPosition.js @@ -14,7 +14,6 @@ exports.getPosition = () => { if (selectionIsInTheBeginningOfLine) { const clonedRange = createSelectionRange(range); line = getPositionOfElementOrSelection(clonedRange); - clonedRange.detach(); } // when there's a
or any element that has no height, we can't get @@ -28,7 +27,6 @@ exports.getPosition = () => { clonedRange.selectNode(shadowCaret[0]); line = getPositionOfElementOrSelection(clonedRange); - clonedRange.detach(); shadowCaret.remove(); return line; };