react-scroll
Advanced tools
Comparing version 1.7.7 to 1.7.8
@@ -30,3 +30,3 @@ 'use strict'; | ||
var scrollOffset = function scrollOffset(c, t) { | ||
return c === document ? t.getBoundingClientRect().top + (window.scrollY || window.pageYOffset) : getComputedStyle(c).position === "relative" ? t.offsetTop : t.offsetTop - c.offsetTop; | ||
return c === document ? t.getBoundingClientRect().top + (window.scrollY || window.pageYOffset) : getComputedStyle(c).position === "relative" ? t.offsetTop : t.getBoundingClientRect().top + c.scrollTop; | ||
}; | ||
@@ -33,0 +33,0 @@ |
{ | ||
"name": "react-scroll", | ||
"version": "1.7.7", | ||
"version": "1.7.8", | ||
"description": "A scroll component for React.js", | ||
@@ -5,0 +5,0 @@ "main": "modules", |
@@ -19,2 +19,14 @@ ## React Scroll | ||
Checkout examples | ||
Live example | ||
> [Basic](https://codesandbox.io/s/py5opl2280) | ||
> [Basic-Keydown](https://codesandbox.io/s/l94kv62o4m) | ||
> [Container](https://codesandbox.io/s/3zznv27l5) | ||
> [With-hash](https://codesandbox.io/s/y0zzrk1v1j) | ||
> [With-overflow](https://codesandbox.io/s/l94kv62o4m) | ||
> [Code](https://github.com/fisshy/react-scroll/blob/master/examples/basic/app.js) | ||
@@ -21,0 +33,0 @@ ```js |
100107
469