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

Commit

Permalink
fix(sticky): improve onScroll logic
Browse files Browse the repository at this point in the history
resolve  possible RTE with `self.current`
  • Loading branch information
ThomasBurleson committed Aug 26, 2015
1 parent 97a8f6d commit 40e5469
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/sticky/sticky.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function MdSticky($document, $mdConstant, $$rAF, $mdUtil) {
}

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

0 comments on commit 40e5469

Please sign in to comment.