scrollbooster
Advanced tools
Comparing version 2.2.1 to 2.2.2
{ | ||
"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(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98467
678