From: Abdullah Salem Date: Wed, 9 Nov 2016 23:11:07 +0000 (+0300) Subject: Fixed the scrolling behavior when auto-focus is active X-Git-Tag: v6.3-rc1~21^2~4^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb501eb185c613f25dbbcce2e0113bfe774800d0;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Fixed the scrolling behavior when auto-focus is active --- diff --git a/js/foundation.tabs.js b/js/foundation.tabs.js index 04215c87d..556f63d73 100644 --- a/js/foundation.tabs.js +++ b/js/foundation.tabs.js @@ -69,8 +69,12 @@ class Tabs { 'aria-labelledby': linkId }); - if(isActive && _this.options.autoFocus){ - $link.focus(); + if(isActive && _this.options.autoFocus){ + $(window).load(function() { + $('html, body').animate({ scrollTop: $elem.offset().top }, _this.options.deepLinkSmudgeDelay, () => { + $link.focus(); + }); + }); } //use browser to open a tab, if it exists in this tabset