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

scrollbooster

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scrollbooster - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

2

package.json
{
"name": "scrollbooster",
"description": "Enjoyable content drag-to-scroll library",
"version": "2.2.1",
"version": "2.2.2",
"author": "Ilya Shubin <pixelwake@gmail.com>",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -33,2 +33,4 @@ const getFullWidth = (elem) => Math.max(elem.offsetWidth, elem.scrollWidth);

const CLICK_EVENT_THRESHOLD_PX = 5;
export default class ScrollBooster {

@@ -498,3 +500,11 @@ /**

this.events.click = (event) => this.props.onClick(this.getState(), event);
this.events.click = (event) => {
const state = this.getState();
if (Math.abs(Math.max(state.dragOffset.x, state.dragOffset.y)) > CLICK_EVENT_THRESHOLD_PX) {
event.preventDefault();
event.stopPropagation();
}
this.props.onClick(state, event);
};
this.events.contentLoad = () => this.updateMetrics();

@@ -501,0 +511,0 @@ this.events.resize = () => this.updateMetrics();

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