diff --git a/src/pyj/read_book/selection_bar.pyj b/src/pyj/read_book/selection_bar.pyj index 0d26a2afe4..8d5f2afd66 100644 --- a/src/pyj/read_book/selection_bar.pyj +++ b/src/pyj/read_book/selection_bar.pyj @@ -527,7 +527,10 @@ class SelectionBar: handle = self.dragging_handle self.dragging_handle = None self.state = WAITING - self.update_position(handle) + # this is done after the event loop ticks because otherwise if + # update_position moves the handle a click event is delivered to the + # container, calling container_clicked() and clearing the selection + window.setTimeout(self.update_position.bind(None, handle), 0) def mouseup_on_container(self, ev): if self.state is DRAGGING: