From 70cf617e791005385f566195fd106469bbbc4b93 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Wed, 25 Jan 2023 09:32:14 +0700 Subject: [PATCH] move originalSelection position Co-authored-by: Youssef Lourayad --- src/libs/Clipboard/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libs/Clipboard/index.js b/src/libs/Clipboard/index.js index 0cd659b1a148..b770b2f2c787 100644 --- a/src/libs/Clipboard/index.js +++ b/src/libs/Clipboard/index.js @@ -29,10 +29,9 @@ function setHTMLSync(html, text) { document.body.appendChild(node); const selection = window.getSelection(); - let originalSelection = null; const firstAnchorChild = selection.anchorNode && selection.anchorNode.firstChild; const isComposer = firstAnchorChild instanceof HTMLTextAreaElement; - + let originalSelection = null; if (isComposer) { originalSelection = { start: firstAnchorChild.selectionStart,