From 3796f82a00d12fce428f062853d58c5b40c17d81 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 8 Aug 2022 11:16:01 +0530 Subject: [PATCH] Content server: Fix long tapping in the notes edit area incorrectly changing the highlight extent. Fixes #1983271 [[Content Server] Note window pops up but text still selectable underneath](https://bugs.launchpad.net/calibre/+bug/1983271) --- src/pyj/read_book/highlights.pyj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pyj/read_book/highlights.pyj b/src/pyj/read_book/highlights.pyj index fbba897d5f..503f640db0 100644 --- a/src/pyj/read_book/highlights.pyj +++ b/src/pyj/read_book/highlights.pyj @@ -353,11 +353,15 @@ class EditNotesAndColors: # {{{ True ) apply_button.style.marginLeft = apply_button.style.marginTop = 'auto' + stop_propagation = def(ev): + ev.stopPropagation() c = E.div( style=f'background: {get_color("window-background")}; margin: auto; text-align: center; padding: 1ex;', - onclick=def(ev): ev.stopPropagation();, + onclick=stop_propagation, id=unique_id(), E.div( + ontouchstart=stop_propagation, ontouchmove=stop_propagation, ontouchend=stop_propagation, ontouchcancel=stop_propagation, + oncontextmenu=stop_propagation, E.textarea( placeholder=_('Add notes for this highlight. Double click or long tap on a highlight to read its notes.'), rows='10', spellcheck='true', style='width: 90%;',