A performant and comprehensive React sticky component.
OTHER License
Bot releases are hidden (Show)
Published by src-code over 8 years ago
Global variables related to the client are now initialized during componentDidMount()
instead of during module execution.
Published by src-code over 8 years ago
Adding ability to change z-index
of the sticky node via the innerZ
prop (thanks @samlecuyer!)
Published by src-code over 8 years ago
If a scrollStart
event is received but the scrollTop
value doesn't seem to have changed from the cached value, skip handling the event and the subsequent scroll
event. This fixes an issue seen when the document's scroll position is being restored (eg, during a page navigation event in a single page app) and sticky may incorrectly attempt to reposition itself due to the scroll event.
Published by src-code over 8 years ago
Adds support for shouldFreeze
prop, a function which allows an implementor to temporarily disable a sticky node through custom logic.
Published by src-code over 8 years ago
Fixes an issue where in release mode, calculations were being performed with a potentially outdated value for this.stickyBottom
.
Published by kaesonho over 8 years ago
#36 - Explicitly add displayName for better debugging, thanks @itssumitrai !
Published by kaesonho over 8 years ago
#34 - Allow passing new props to updateInitialDimension, thanks @codeheroics !
Published by kaesonho over 8 years ago
#33 - Change function to es6 syntax
Published by kaesonho over 8 years ago
#31 - Toggling sticky behavior, thanks @egadstar !
Published by kaesonho over 8 years ago
#32 - fixed Sticky not being fixed when calling window.scrollTo()
Published by hankhsiao over 8 years ago
Now Sticky support React@15 as well!
Thank @roderickhsiao
Published by hankhsiao over 8 years ago
In many situations, we need to do something according to sticky status. Previously, we had contextual class to help us know sticky status, now we have a callback function! Thank you @eligolding.
https://github.com/yahoo/react-stickynode#handling-state-change
Published by hankhsiao over 8 years ago
Fix that Sticky doesn't recalculate dimension when it's parent gets updated.
Published by hankhsiao over 8 years ago
Fixed the issue that Sticky is in FIXED status and its height gets changed, it will be always FIXED.
Published by hankhsiao over 8 years ago
We introduced a prop activeClass
which will set to Sticky class when it is in fixed status. By default, the value of the prop is active
. This feature provide flexibility to users to do more their own stuffs.
@fender
Published by hankhsiao over 8 years ago
In some situation, for example, responsive design, Sticky will be set as display:none
. In this case, Sticky should be disable for better performance.
Thanks @testerez.
Published by hankhsiao over 8 years ago
Sticky wrapper will keep the width as that of its content to avoid the width being changed by Sticky state change. This release fixed incorrect calculation of the width.
Published by hankhsiao over 8 years ago
We added enableTransforms
prop in case you cannot add Modernizr
, so that you can disable transform
. The default is true
, so Modernizr is required by default. But still, strongly recommend to use the default value for the performance.
Thank @codeheroics for the contribution.
https://github.com/yahoo/react-stickynode/commit/256fb94df55e7b0010e2c2b10553bc4774aa0b2c
Published by hankhsiao over 8 years ago
Using getBoundingClientRect() instead of offsetHeight to get better precision.
Published by hankhsiao over 8 years ago
Sticky keeps content width, and height to avoid collapse when its state is "fixed". Sticky got width from the offsetWidth of content, but the width is rounded. A better way is to get width from calling getBoundingClientRect()
, thank @testerez. To support lower browser (IE8 and lower), we fallback like
var outerRect = outer.getBoundingClientRect();
var width = outerRect.width || outerRect.right - outerRect.left;