Skip to content

Commit

Permalink
Fix issue #Issue28820 - Small change
Browse files Browse the repository at this point in the history
  • Loading branch information
AmjedNazzal authored Oct 30, 2023
1 parent 90f1631 commit 82bf64e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/Clipboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ function setHTMLSync(html, text) {
if (isComposer) {
firstAnchorChild.setSelectionRange(originalSelection.start, originalSelection.end, originalSelection.direction);
} else if (originalSelection.anchorNode && originalSelection.focusNode) {
// When copying to clipboard here, since there will be no user selection the original values of anchorNode and focusNode will be null
// We are adding a check to prevent null values from being passed to setBaseAndExtent as per the standards of the Selection api https://w3c.github.io/selection-api/#dom-selection-setbaseandextent
// When copying to the clipboard here, the original values of anchorNode and focusNode will be null since there will be no user selection.
// We are adding a check to prevent null values from being passed to setBaseAndExtent, in accordance with the standards of the Selection API as outlined here: https://w3c.github.io/selection-api/#dom-selection-setbaseandextent.
selection.setBaseAndExtent(originalSelection.anchorNode, originalSelection.anchorOffset, originalSelection.focusNode, originalSelection.focusOffset);
}

Expand Down

0 comments on commit 82bf64e

Please sign in to comment.