diff --git a/src/BookReader/Mode2UpLit.js b/src/BookReader/Mode2UpLit.js index 4a1c81829..47844bd6c 100644 --- a/src/BookReader/Mode2UpLit.js +++ b/src/BookReader/Mode2UpLit.js @@ -676,6 +676,15 @@ export class Mode2UpLit extends LitElement { if (ev.which != 1) return; + // Don't flip the page if the user is completing a text-selection + // drag. The page-flip handler runs on `mouseup`, so releasing the + // mouse at the end of a selection would otherwise trigger + // `br.left()` / `br.right()` and clobber the selection. The text + // selection plugin's own mouseup handler stops propagation when the + // mouseup lands on a word, but not when it lands in blank space + // between words or on the page margin. + if (window.getSelection?.()?.toString().trim()) return; + const $page = $(ev.target).closest('.BRpagecontainer'); if (!$page.length) return; if ($page.data('side') == 'L') {