We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6ef046 commit da40d2cCopy full SHA for da40d2c
packages/text-annotator/src/SelectionHandler.ts
@@ -27,7 +27,15 @@ export const createSelectionHandler = (
27
28
let currentAnnotatingEnabled = true;
29
30
- const setAnnotatingEnabled = (enabled: boolean) => currentAnnotatingEnabled = enabled;
+ const setAnnotatingEnabled = (enabled: boolean) => {
31
+ currentAnnotatingEnabled = enabled;
32
+ onSelectionChange.clear();
33
+
34
+ if (!enabled) {
35
+ currentTarget = undefined;
36
+ lastPointerDown = undefined;
37
+ }
38
+ };
39
40
const { store, selection } = state;
41
0 commit comments