From 1c9db874920ef6e7b3a1ee4c4fb6d6f3911b83ae Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 18 Feb 2020 08:29:22 +0530 Subject: [PATCH] Also add touch-action: none to the main document --- src/pyj/book_list/main.pyj | 4 +++- src/pyj/viewer-main.pyj | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pyj/book_list/main.pyj b/src/pyj/book_list/main.pyj index b52de2eb9a..23a6d01152 100644 --- a/src/pyj/book_list/main.pyj +++ b/src/pyj/book_list/main.pyj @@ -67,7 +67,9 @@ def init_ui(): install(translations) remove_initial_progress_bar() document.head.appendChild(E.style(get_widget_css())) - set_css(document.body, background_color=get_color('window-background'), color=get_color('window-foreground')) + # See https://github.com/kovidgoyal/calibre/pull/1101 + # for why we need touch-action: none + set_css(document.body, background_color=get_color('window-background'), color=get_color('window-foreground'), touch_action='none') document.body.appendChild(E.div()) document.body.lastChild.appendChild(E.div(id=book_list_container_id, style='display: none')) document.body.lastChild.appendChild(E.div(id=read_book_container_id, style='display: none')) diff --git a/src/pyj/viewer-main.pyj b/src/pyj/viewer-main.pyj index 0899da7a53..8da2bedf32 100644 --- a/src/pyj/viewer-main.pyj +++ b/src/pyj/viewer-main.pyj @@ -408,7 +408,9 @@ if window is window.top: window.onerror = onerror create_modal_container() document.head.appendChild(E.style(get_widget_css())) - set_css(document.body, background_color=get_color('window-background'), color=get_color('window-foreground')) + # See https://github.com/kovidgoyal/calibre/pull/1101 + # for why we need touch-action: none + set_css(document.body, background_color=get_color('window-background'), color=get_color('window-foreground'), touch_action='none') setTimeout(def(): window.onpopstate = on_pop_state , 0) # We do this after event loop ticks over to avoid catching popstate events that some browsers send on page load