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: