mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 20:03:43 +02:00
Fix modals not getting keyboard focus in updated WebEngine
This commit is contained in:
parent
bea311405a
commit
868a2c8967
1 changed files with 4 additions and 5 deletions
|
|
@ -90,7 +90,7 @@ def show_modal(self, create_func, on_close=None, show_close=True, onkeydown=None
|
|||
self.modals.push(Modal(create_func, on_close, show_close, onkeydown))
|
||||
modal_id = self.modals[-1].id
|
||||
self.update()
|
||||
self.modal_container.focus()
|
||||
window.setTimeout(def(): self.modal_container.focus();, 0)
|
||||
return modal_id
|
||||
|
||||
def hide_modal(self, modal_id):
|
||||
|
|
@ -294,10 +294,9 @@ def on_keydown(event, close_modal):
|
|||
create_button(no_text, 'close', keyaction.bind(None, False, close_modal))
|
||||
))
|
||||
)
|
||||
parent.lastChild.focus()
|
||||
,
|
||||
on_close=keyaction.bind(None, False, None),
|
||||
onkeydown=on_keydown
|
||||
,
|
||||
on_close=keyaction.bind(None, False, None),
|
||||
onkeydown=on_keydown
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue