Skip to content

Commit

Permalink
Fix copy
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Aug 5, 2024
1 parent d477b96 commit 51a5ce9
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Internal dependencies
*/
import { toHTMLString } from '../../to-html-string';
import { isCollapsed } from '../../is-collapsed';
import { slice } from '../../slice';
import { getTextContent } from '../../get-text-content';

Expand All @@ -11,11 +10,12 @@ export default ( props ) => ( element ) => {
const { record } = props.current;
const { ownerDocument } = element;
const { defaultView } = ownerDocument;
const { anchorNode, focusNode } = defaultView.getSelection();
const { anchorNode, focusNode, isCollapsed } =
defaultView.getSelection();
const containsSelection =
element.contains( anchorNode ) && element.contains( focusNode );

if ( isCollapsed( record.current ) || ! containsSelection ) {
if ( isCollapsed || ! containsSelection ) {
return;
}

Expand Down

0 comments on commit 51a5ce9

Please sign in to comment.