From 6265485813e1a363ec05380346f8c2017846c75d Mon Sep 17 00:00:00 2001 From: Kaeson Ho Date: Tue, 19 Apr 2016 17:10:19 -0700 Subject: [PATCH] fixed Sticky not being fixed when calling window.scrollTo() --- src/Sticky.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Sticky.jsx b/src/Sticky.jsx index ef7ece02..6f642efa 100644 --- a/src/Sticky.jsx +++ b/src/Sticky.jsx @@ -222,7 +222,9 @@ class Sticky extends Component { self.release(self.state.y); self.stickyTop = self.state.y; self.stickyBottom = self.stickyTop + self.state.height; - break; + // Commentting out "break" is on purpose, because there is a chance to transit to FIXED + // from ORIGINAL when calling window.scrollTo(). + // break; case STATUS_RELEASED: // If "top" and "bottom" are inbetween stickyTop and stickyBottom, then Sticky is in // RELEASE status. Otherwise, it changes to FIXED status, and its bottom sticks to