Skip to content

Commit

Permalink
move originalSelection position
Browse files Browse the repository at this point in the history
Co-authored-by: Youssef Lourayad <youssef.lourayad@gmail.com>
  • Loading branch information
wildan-m and youssef-lr authored Jan 25, 2023
1 parent 493c114 commit 70cf617
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libs/Clipboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 70cf617

Please sign in to comment.