From 32baf23f215ec24c376e2f76de1a4c601df96b64 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 19 Jan 2024 22:27:45 +0530 Subject: [PATCH] Fix #2049928 [go to location shortcut doesn't change cursor focus properly](https://bugs.launchpad.net/calibre/+bug/2049928) --- src/pyj/read_book/goto.pyj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pyj/read_book/goto.pyj b/src/pyj/read_book/goto.pyj index 3208dfaed9..02983a7b16 100644 --- a/src/pyj/read_book/goto.pyj +++ b/src/pyj/read_book/goto.pyj @@ -150,4 +150,8 @@ def create_location_overlay(current_position_data, book, overlay, container): display_and_copy(_('URL for this position:'), calibre_book_url) elif not runtime.is_standalone_viewer: display_and_copy(_('URL for this position:'), window.top.location.toString()) - container.querySelector('[name=newpos]').focus() + window.setTimeout(def(): + container = document.getElementById(container_id) + if container: + container.querySelector('[name=newpos]').focus() + , 10)