Skip to content

Commit

Permalink
Merge branch 'recogito#136-fix-not-dismisssed-annotation-on-native-ra…
Browse files Browse the repository at this point in the history
…nge-click' into keyboard-event-selection

# Conflicts:
#	packages/text-annotator/src/SelectionHandler.ts
  • Loading branch information
oleksandr-danylchenko committed Sep 2, 2024
2 parents b35904c + 3444946 commit 9316a66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/text-annotator/src/SelectionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export const SelectionHandler = (

const timeDifference = evt.timeStamp - lastDownEvent.timeStamp;

/**
/**
* We must check the `isCollapsed` within the 0-timeout
* to handle the annotation dismissal after a click properly.
*
Expand All @@ -205,7 +205,7 @@ export const SelectionHandler = (

// Just a click, not a selection
if (sel?.isCollapsed && timeDifference < CLICK_TIMEOUT) {
currentTarget = undefined;
currentTarget = undefined;
clickSelect();
} else if (currentTarget && store.getAnnotation(currentTarget.annotation)) {
selection.userSelect(currentTarget.annotation, evt);
Expand Down

0 comments on commit 9316a66

Please sign in to comment.