Skip to content

Commit

Permalink
Fix another case where selection could remain after resize
Browse files Browse the repository at this point in the history
  • Loading branch information
AbeJellinek committed Nov 15, 2024
1 parent a0214a8 commit 17e096b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dom/common/dom-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,8 @@ 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 @@ -963,7 +965,6 @@ abstract class DOMView<State extends DOMViewState, Data> {
this._options.onUpdateAnnotations([annotation]);
}

event.preventDefault();
return;
}

Expand Down

0 comments on commit 17e096b

Please sign in to comment.