From fdc625b4d1ba26782ff81ec2d79c1b533f26a9a7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 6 Dec 2016 13:47:20 +0100 Subject: [PATCH] focus: scroll to active element --- js/common.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/common.js b/js/common.js index e19f7f209..84e0b26dc 100644 --- a/js/common.js +++ b/js/common.js @@ -235,6 +235,10 @@ $(function () { } } + // scroll to the active element. jQuery.focus doesn't do this + // TODO: find out how to reliably frame the active element + window.scrollTo(0, document.activeElement.getBoundingClientRect().top); + // legacy. sone forms install these if (typeof fokus == 'function') { fokus(); return; } if (focus_by_name('cursor_fokus')) return; -- 2.20.1