From 07df91ecd8093156b5c54cb07f17acaa8b762fcc Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Fri, 15 Nov 2024 11:04:42 -0500 Subject: [PATCH] fixup --- src/dom/common/dom-view.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/dom/common/dom-view.tsx b/src/dom/common/dom-view.tsx index 73eea308..fa8ce828 100644 --- a/src/dom/common/dom-view.tsx +++ b/src/dom/common/dom-view.tsx @@ -904,8 +904,6 @@ abstract class DOMView { if (this._selectedAnnotationIDs.length === 1 && (key.endsWith('Shift-ArrowLeft') || key.endsWith('Shift-ArrowRight'))) { - event.preventDefault(); - let annotation = this._annotationsByID.get(this._selectedAnnotationIDs[0])!; let oldRange = this.toDisplayedRange(annotation.position)!; if (annotation.type === 'note') { @@ -957,14 +955,13 @@ abstract class DOMView { } selection.removeAllRanges(); - if (newRange.collapsed) { - return; + if (!newRange.collapsed) { + this._setAnnotationRange(annotation, newRange); + this._options.onUpdateAnnotations([annotation]); } - - this._setAnnotationRange(annotation, newRange); - this._options.onUpdateAnnotations([annotation]); } + event.preventDefault(); return; }