Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
AbeJellinek committed Nov 15, 2024
1 parent 17e096b commit 07df91e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/dom/common/dom-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,6 @@ abstract class DOMView<State extends DOMViewState, Data> {
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') {
Expand Down Expand Up @@ -957,14 +955,13 @@ abstract class DOMView<State extends DOMViewState, Data> {
}
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;
}

Expand Down

0 comments on commit 07df91e

Please sign in to comment.