From 63e2387853d69b39454e71ec8006d2b512e86248 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 31 Jan 2016 16:35:26 +0000 Subject: Fix visual indicator for `focusInput()`. Currently, if an input is only partially in the view port, then the page may scroll when it is focused and the overlays for `focusInput()` are wonky. See #1257. Here, we draw the overlay around the *entire* input, instead of just around the visible part. Being partially visible therefore is no longer relevant. Fixes #1257. Closes #1258. --- content_scripts/vimium_frontend.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 145a7508..f596ccf7 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -385,9 +385,8 @@ extend window, visibleInputs = for i in [0...resultSet.snapshotLength] by 1 element = resultSet.snapshotItem i - rect = DomUtils.getVisibleClientRect element, true - continue if rect == null - { element: element, rect: rect } + continue unless DomUtils.getVisibleClientRect element, true + { element, rect: DomUtils.getBoundingClientRect element } if visibleInputs.length == 0 HUD.showForDuration("There are no inputs to focus.", 1000) -- cgit v1.2.3