From 86debe8dd0a7cfd766aa364ad1641b3ec383ac97 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 28 Jul 2020 19:20:35 +0530 Subject: [PATCH] Dont show selection bar during drag scroll --- src/pyj/read_book/iframe.pyj | 2 ++ src/pyj/read_book/selection_bar.pyj | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pyj/read_book/iframe.pyj b/src/pyj/read_book/iframe.pyj index 057d8193e2..48a827b295 100644 --- a/src/pyj/read_book/iframe.pyj +++ b/src/pyj/read_book/iframe.pyj @@ -583,6 +583,8 @@ class IframeBoss: def onmouseup(self, evt): cancel_drag_scroll() drag_mouse_position.x = drag_mouse_position.y = None + # ensure selection bar is updated + self.onselectionchange() def onkeydown(self, evt): if current_layout_mode() is not 'flow' and evt.key is 'Tab': diff --git a/src/pyj/read_book/selection_bar.pyj b/src/pyj/read_book/selection_bar.pyj index 71296f4b75..579174ca05 100644 --- a/src/pyj/read_book/selection_bar.pyj +++ b/src/pyj/read_book/selection_bar.pyj @@ -171,7 +171,7 @@ class SelectionBar: container = self.container clear(container) cs = self.view.currently_showing.selection - if not cs or cs.empty: + if not cs or cs.empty or jstype(cs.drag_mouse_position.x) is 'number': return self.hide() if not cs.start.onscreen and not cs.end.onscreen: