Skip to content

Commit 87587d2

Browse files
Fixed checking null selection for not annotatable
1 parent c5ffd36 commit 87587d2

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 (isNotAnnotatable(sel.anchorNode)) {
83+
if (!sel?.isCollapsed && isNotAnnotatable(sel.anchorNode)) {
8484
currentTarget = undefined;
8585
return;
8686
}

0 commit comments

Comments
 (0)