Releases: yahoo/react-stickynode
Compatible with React@15 and React@0.14
Now Sticky support React@15 as well!
Thank @roderickhsiao
Introduce State Change Handling
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
Fix Sticky recalculation issue
Fix that Sticky doesn't recalculate dimension when it's parent gets updated.
Fix some issues
Fixed the issue that Sticky is in FIXED status and its height gets changed, it will be always FIXED.
Introduce active class
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.
Support responsive
Bug fix
Support enableTransforms
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.
Better precision on height
Using getBoundingClientRect() instead of offsetHeight to get better precision.
More precise content width
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;