From d7989878bed93a01b1f25845a1411cfb70ad2313 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Wed, 20 Sep 2023 13:30:01 +0200 Subject: [PATCH] Fix annotating part of a line --- .../javascripts/components/annotations/selectionHelpers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/components/annotations/selectionHelpers.ts b/app/assets/javascripts/components/annotations/selectionHelpers.ts index e259031262..604de9644d 100644 --- a/app/assets/javascripts/components/annotations/selectionHelpers.ts +++ b/app/assets/javascripts/components/annotations/selectionHelpers.ts @@ -218,7 +218,8 @@ export function triggerSelectionStart(e: PointerEvent): void { if (!(e.target as Element).closest(".annotation") && !userAnnotationState.formShown) { addSelectionClasses(); - if (!(e.target as Element).closest("button")) { + // reset the selection, unless we are clicking on a button or link (eg. the create annotation button) + if (!(e.target as Element).closest("button,a")) { userAnnotationState.selectedRange = undefined; } }