From f92f70da44a7699ff8145aea542cf1eb6d376c19 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 11 May 2017 17:24:09 +0530 Subject: [PATCH] Same work around for the search overlay in Chrome for Android --- src/pyj/read_book/search.pyj | 4 ++++ src/pyj/read_book/view.pyj | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pyj/read_book/search.pyj b/src/pyj/read_book/search.pyj index c3a93ea486..a03eefab4f 100644 --- a/src/pyj/read_book/search.pyj +++ b/src/pyj/read_book/search.pyj @@ -55,6 +55,10 @@ class SearchOverlay: def search_text(self): return self.container.querySelector('input').value + @property + def is_visible(self): + return self.container.style.display is not 'none' + def hide(self): self.container.style.display = 'none' diff --git a/src/pyj/read_book/view.pyj b/src/pyj/read_book/view.pyj index e5fc039352..1e200f032e 100644 --- a/src/pyj/read_book/view.pyj +++ b/src/pyj/read_book/view.pyj @@ -392,7 +392,7 @@ class View: self.goto_named_destination(toc_node.dest, toc_node.frag) def on_update_cfi(self, data): - if self.overlay.is_visible: + if self.overlay.is_visible or self.search_overlay.is_visible: # Chrome on Android stupidly resizes the viewport when the on # screen keyboard is displayed. This means that the push_state() # below causes the overlay to be closed, making it impossible to