From 5af33da1b532e4180c3faac8ea6d8354db67765b Mon Sep 17 00:00:00 2001 From: ark-tds Date: Fri, 2 Nov 2018 23:17:47 +0900 Subject: [PATCH] Make it possible to scrollIntoView() to document.body --- src/smoothscroll.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/smoothscroll.js b/src/smoothscroll.js index 1d21e54..2b3452d 100644 --- a/src/smoothscroll.js +++ b/src/smoothscroll.js @@ -158,6 +158,10 @@ function polyfill() { function findScrollableParent(el) { var isBody; + if (el === d.body) { + return el; + } + do { el = el.parentNode;