Releases: yahoo/react-stickynode
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;
Keep the height of content
Explicitly set sticky height as the content height to avoid document collapse when sticky is fixed state.
#16