Skip to content

Commit f7a5ee9

Browse files
Added precise anchorNode presence check
1 parent 87587d2 commit f7a5ee9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/text-annotator/src/SelectionHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const SelectionHandler = (
8080
// This is to handle cases where the selection is "hijacked" by another element
8181
// in a not-annotatable area. A rare case in theory. But rich text editors
8282
// will like Quill do it...
83-
if (!sel?.isCollapsed && isNotAnnotatable(sel.anchorNode)) {
83+
if (sel?.anchorNode && isNotAnnotatable(sel.anchorNode)) {
8484
currentTarget = undefined;
8585
return;
8686
}

0 commit comments

Comments
 (0)