We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de9db41 commit e42bffeCopy full SHA for e42bffe
src/index.js
@@ -19,11 +19,15 @@ export default class GradientScroll extends Component {
19
this.handleScroll();
20
}
21
22
+ componentDidUpdate(prevProps) {
23
+ if (prevProps.children !== this.props.children) {
24
+ this.handleScroll();
25
+ }
26
27
+
28
handleScroll = () => {
29
const scrollableScrollTop = this.scrollableElement.scrollTop;
- const scrollableHeight = this.scrollableElement.clientHeight;
30
const contentHeight = this.contentElement.clientHeight;
- const diff = scrollableScrollTop - contentHeight;
31
const atBottom = this.scrollableElement.scrollHeight === contentHeight + scrollableScrollTop;
32
const overlayClasses = [];
33
if (scrollableScrollTop === 0) {
0 commit comments