From cb501eb185c613f25dbbcce2e0113bfe774800d0 Mon Sep 17 00:00:00 2001 From: Abdullah Salem Date: Thu, 10 Nov 2016 02:11:07 +0300 Subject: [PATCH] Fixed the scrolling behavior when auto-focus is active --- js/foundation.tabs.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 -- 2.47.2