Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-stickynode

Package Overview
Dependencies
Maintainers
5
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-stickynode - npm Package Compare versions

Comparing version 2.1.1 to 3.0.0

45

dist/Sticky.js

@@ -100,5 +100,4 @@ /**

value: function getTopPosition(top) {
// TODO, topTarget is for current layout, may remove
// a top argument can be provided to override reading from the props
top = top || this.props.top || this.props.topTarget || 0;
top = top || this.props.top || 0;
if (typeof top === 'string') {

@@ -331,8 +330,2 @@ if (!this.topTarget) {

}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
this.updateInitialDimension(nextProps);
this.update();
}
}, {
key: 'componentDidUpdate',

@@ -345,14 +338,22 @@ value: function componentDidUpdate(prevProps, prevState) {

}
// if the props for enabling are toggled, then trigger the update or reset depending on the current props
if (prevProps.enabled !== this.props.enabled) {
if (this.props.enabled) {
this.setState({ activated: true }, function () {
_this.updateInitialDimension();
_this.update();
});
} else {
this.setState({ activated: false }, function () {
_this.reset();
});
var arePropsChanged = !(0, _shallowequal2['default'])(this.props, prevProps);
if (arePropsChanged) {
// if the props for enabling are toggled, then trigger the update or reset depending on the current props
if (prevProps.enabled !== this.props.enabled) {
if (this.props.enabled) {
this.setState({ activated: true }, function () {
_this.updateInitialDimension();
_this.update();
});
} else {
this.setState({ activated: false }, function () {
_this.reset();
});
}
}
// if the top or bottomBoundary props were changed, then trigger the update
else if (prevProps.top !== this.props.top || prevProps.bottomBoundary !== this.props.bottomBoundary) {
this.updateInitialDimension();
this.update();
}
}

@@ -447,3 +448,3 @@ }

_this2.innerElement = inner;
}, className: 'sticky-inner-wrapper', style: innerStyle },
}, className: ['sticky-inner-wrapper', this.props.innerClass].join(' '), style: innerStyle },
typeof children === 'function' ? children({ status: this.state.status }) : children

@@ -470,3 +471,4 @@ )

releasedClass: 'released',
onStateChange: null
onStateChange: null,
innerClass: ''
};

@@ -489,2 +491,3 @@

releasedClass: _propTypes2['default'].string,
innerClass: _propTypes2['default'].string,
onStateChange: _propTypes2['default'].func,

@@ -491,0 +494,0 @@ shouldFreeze: _propTypes2['default'].func,

{
"name": "react-stickynode",
"version": "2.1.1",
"version": "3.0.0",
"description": "A performant and comprehensive React sticky",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -57,2 +57,3 @@ # react-stickynode

| `activeClass` | String | Class name to be applied to the element when the sticky state is active (`active` by default). |
| `innerClass` | String | Class name to be applied to the inner element (`''` by default). |
| `releasedClass` | String | Class name to be applied to the element when the sticky state is released (`released` by default). |

@@ -59,0 +60,0 @@ | `onStateChange` | Function | Callback for when the sticky state changes. See below. |

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc