Same work around for the search overlay in Chrome for Android

This commit is contained in:
Kovid Goyal 2017-05-11 17:24:09 +05:30
parent de6e5ec8d6
commit f92f70da44
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 1 deletions

View File

@ -55,6 +55,10 @@ class SearchOverlay:
def search_text(self): def search_text(self):
return self.container.querySelector('input').value return self.container.querySelector('input').value
@property
def is_visible(self):
return self.container.style.display is not 'none'
def hide(self): def hide(self):
self.container.style.display = 'none' self.container.style.display = 'none'

View File

@ -392,7 +392,7 @@ class View:
self.goto_named_destination(toc_node.dest, toc_node.frag) self.goto_named_destination(toc_node.dest, toc_node.frag)
def on_update_cfi(self, data): 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 # Chrome on Android stupidly resizes the viewport when the on
# screen keyboard is displayed. This means that the push_state() # screen keyboard is displayed. This means that the push_state()
# below causes the overlay to be closed, making it impossible to # below causes the overlay to be closed, making it impossible to