From 88a73eec999ba13e0f60fef6d3eedb839c28ae29 Mon Sep 17 00:00:00 2001 From: Phil Eaton Date: Mon, 8 May 2017 16:35:52 -0400 Subject: [PATCH] Account for header in scroll and scroll to section not header --- docs/src/App.js | 3 +++ docs/src/components/Method.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/src/App.js b/docs/src/App.js index c36345ece3c..3810f4435af 100644 --- a/docs/src/App.js +++ b/docs/src/App.js @@ -41,6 +41,7 @@ function hashLinkScroll() { const element = document.getElementById(id); if (element) { element.scrollIntoView(); + window.scrollBy(0, -60); // Offset for header } }, 0); } @@ -52,6 +53,8 @@ function onRouterUpdate() { } export function init() { + setTimeout(() => hashLinkScroll(), 0); + render( -

{name}

+
+

{name}

{description}