From c4de6b9bd914bf188b3c6256c33c3c64cd179fb9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 5 Mar 2025 08:26:24 +0530 Subject: [PATCH] Fix #2099678 [Clicking on an article in a newsletter scrolls the Table of Contents to the end](https://bugs.launchpad.net/calibre/+bug/2099678) --- src/pyj/read_book/paged_mode.pyj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyj/read_book/paged_mode.pyj b/src/pyj/read_book/paged_mode.pyj index 3f8d1536ad..0cf8f0de1b 100644 --- a/src/pyj/read_book/paged_mode.pyj +++ b/src/pyj/read_book/paged_mode.pyj @@ -850,7 +850,7 @@ def handle_gesture(gesture): def get_bounding_client_rect(elem): br = elem.getBoundingClientRect() - if br.width is 0 and br.height is 0: + if br.width is 0 and br.height is 0 and br.x is 0 and br.y is 0: # getBoundingClientRect() fails sometimes, see https://bugs.launchpad.net/calibre/+bug/2037543 r = document.createRange() r.selectNodeContents(elem)