Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 40e5469

Browse files
fix(sticky): improve onScroll logic
resolve possible RTE with `self.current`
1 parent 97a8f6d commit 40e5469

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/sticky/sticky.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ function MdSticky($document, $mdConstant, $$rAF, $mdUtil) {
204204
}
205205

206206
// If the next item is close to the current one, pull the current one down into view
207-
if (self.next && scrollTop >= self.next.top - self.current.height) {
207+
if (self.next && self.current && (scrollTop >= (self.next.top - self.current.height))) {
208208
translate(self.current, scrollTop + (self.next.top - scrollTop - self.current.height));
209209
return;
210210
}

0 commit comments

Comments
 (0)