From a4c727a9b303ae8fed39ff51e58ceaa5aa833606 Mon Sep 17 00:00:00 2001 From: Andrius Stonys Date: Mon, 11 Sep 2017 17:18:57 +0300 Subject: [PATCH] Fix to calculate correct scroll position if container is provided --- lib/angular-smooth-scroll.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/angular-smooth-scroll.js b/lib/angular-smooth-scroll.js index df0c269..baf157b 100644 --- a/lib/angular-smooth-scroll.js +++ b/lib/angular-smooth-scroll.js @@ -87,7 +87,7 @@ do { location += element.offsetTop; element = element.offsetParent; - } while (element); + } while (element && element !== container); } location = Math.max(location - offset, 0); return location;