From 9ccae5b2511833b58bb0ca6d97b8a7c15fda2012 Mon Sep 17 00:00:00 2001 From: Nicky Lenaers Date: Sat, 22 Jul 2017 19:07:38 +0200 Subject: [PATCH] Handle hidden overflow - This fixes #11 --- src/scroll-to.service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/scroll-to.service.ts b/src/scroll-to.service.ts index e11faf1..1441978 100644 --- a/src/scroll-to.service.ts +++ b/src/scroll-to.service.ts @@ -70,6 +70,9 @@ export class ScrollToService { // Skip Absolute Positioning if (style.position === 'absolute') continue; + // Skip Hidden Overflow + if (style.overflow === 'hidden' || style.overflowY === 'hidden') continue; + // Return Body if (parent.tagName === 'BODY') return parent;