From 40b65e166a0a625c1569c3ae9df5abbd51753996 Mon Sep 17 00:00:00 2001 From: John Factotum <50942278+johnfactotum@users.noreply.github.com> Date: Sat, 30 Nov 2024 12:42:13 +0800 Subject: [PATCH] Prevent annotation popover when selecting Fixes #1441 --- src/reader/reader.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/reader/reader.js b/src/reader/reader.js index 34a6d22b..fc500552 100644 --- a/src/reader/reader.js +++ b/src/reader/reader.js @@ -383,6 +383,8 @@ class Reader { const sel = doc.getSelection() const range = getSelectionRange(sel) if (!range) return + // prevent click event + doc.addEventListener('click', e => e.stopPropagation(), { capture: true, once: true }) const pos = getPosition(range) const value = this.view.getCFI(index, range) const lang = getLang(range.commonAncestorContainer)