Skip to content

Commit

Permalink
Fix ctrl+A
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Feb 18, 2022
1 parent 388f719 commit d44bd99
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,15 @@ export default function useMultiSelection() {
return;
}

const { anchorNode, focusNode } = defaultView.getSelection();

if (
isSimpleContentEditable( startRef.current ) &&
isSimpleContentEditable( endRef.current )
( startRef.current.contains( anchorNode ) ||
startRef.current.contains( focusNode ) ) &&
isSimpleContentEditable( endRef.current ) &&
( endRef.current.contains( anchorNode ) ||
endRef.current.contains( focusNode ) )
) {
return;
}
Expand Down

0 comments on commit d44bd99

Please sign in to comment.