From 0e5cc3aedd8b0eb8c12bd863fc042f9b51638342 Mon Sep 17 00:00:00 2001 From: Roland Schmitt Date: Thu, 16 May 2024 17:50:12 +0200 Subject: [PATCH] MET-3209 fix error when user selects empty text (e.g. double click on space between words) --- src/selection/SelectionHandler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/selection/SelectionHandler.js b/src/selection/SelectionHandler.js index 9af2ae6..a4bbaac 100644 --- a/src/selection/SelectionHandler.js +++ b/src/selection/SelectionHandler.js @@ -97,7 +97,8 @@ export default class SelectionHandler extends EventEmitter { selection: top, element: this.document.querySelector(`.r6o-annotation[data-id="${top.id}"]`) }); - } else { + } else if (stub.quote) { + // User selected new text (but skip empty selections) this.emit('select', { selection: stub, element: selectedRange