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 1.1.1 to 1.1.2

30

dist/Sticky.js

@@ -49,3 +49,2 @@ /**

var scrollDelta = 0;
var scrollTop = -1;
var win;

@@ -59,3 +58,2 @@ var winHeight = -1;

docBody = doc.body;
scrollTop = docBody.scrollTop + docEl.scrollTop;
winHeight = win.innerHeight || docEl.clientHeight;

@@ -84,2 +82,4 @@ M = window.Modernizr;

this.frozen = false;
this.skipNextScrollEvent = false;
this.scrollTop = -1;

@@ -132,3 +132,3 @@ this.bottomBoundaryTarget;

var rect = target.getBoundingClientRect();
return scrollTop + rect.bottom;
return this.scrollTop + rect.bottom;
}

@@ -199,3 +199,3 @@ }, {

var height = innerRect.height || innerRect.bottom - innerRect.top;;
var outerY = outerRect.top + scrollTop;
var outerY = outerRect.top + this.scrollTop;

@@ -233,4 +233,10 @@ self.setState({

scrollTop = ae.scroll.top;
this.updateInitialDimension();
if (this.scrollTop === ae.scroll.top) {
// Scroll position hasn't changed,
// do nothing
this.skipNextScrollEvent = true;
} else {
this.scrollTop = ae.scroll.top;
this.updateInitialDimension();
}
}

@@ -240,3 +246,5 @@ }, {

value: function handleScroll(e, ae) {
if (this.frozen) {
// Scroll doesn't need to be handled
if (this.skipNextScrollEvent) {
this.skipNextScrollEvent = false;
return;

@@ -246,3 +254,3 @@ }

scrollDelta = ae.scroll.delta;
scrollTop = ae.scroll.top;
this.scrollTop = ae.scroll.top;
this.update();

@@ -270,4 +278,4 @@ }

// on document from viewport.
var top = scrollTop + self.state.top;
var bottom = scrollTop + self.state.bottom;
var top = this.scrollTop + self.state.top;
var bottom = this.scrollTop + self.state.bottom;

@@ -388,3 +396,3 @@ // There are 2 principles to make sure Sticky won't get wrong so much:

// when mount, the scrollTop is not necessary on the top
scrollTop = docBody.scrollTop + docEl.scrollTop;
this.scrollTop = docBody.scrollTop + docEl.scrollTop;

@@ -391,0 +399,0 @@ if (self.props.enabled) {

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

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

@@ -18,4 +18,2 @@ # react-stickynode

This is also inspired by [Steve Carlson](https://github.com/src-code).
## Features

@@ -22,0 +20,0 @@

Sorry, the diff of this file is not supported yet

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