From a9e2a4a5729070e6961a66443c0bffdb972e4a4b Mon Sep 17 00:00:00 2001 From: anurag sharma Date: Thu, 4 Jul 2019 14:08:06 +0800 Subject: [PATCH] Fix double tap threshold --- README.md | 2 +- index.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1720293..642c7e2 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ import SortableGrid from 'react-native-sortable-grid' How long must the user hold the press on the block until it becomes active and can be dragged (milliseconds) - - ``` doubleTapTreshold ``` **Number** + - ``` doubleTapThreshold ``` **Number** How long will the execution wait for the second tap before deciding it was a single tap (milliseconds). Will be omitted if no onDoubleTap-property is given to the item being tapped - In which case single-tap callback will be executed instantly diff --git a/index.js b/index.js index 4b91802..8328511 100644 --- a/index.js +++ b/index.js @@ -77,7 +77,7 @@ class SortableGrid extends Component { this.activeBlockCenteringDuration = ACTIVE_BLOCK_CENTERING_DURATION this.itemsPerRow = ITEMS_PER_ROW this.dragActivationTreshold = DRAG_ACTIVATION_TRESHOLD - this.doubleTapTreshold = DOUBLETAP_TRESHOLD + this.doubleTapThreshold = DOUBLETAP_TRESHOLD this.onDragRelease = NULL_FN this.onDragStart = NULL_FN this.onDeleteItem = NULL_FN @@ -496,7 +496,7 @@ class SortableGrid extends Component { this.tapTimer = setTimeout( () => { this.doubleTapWait = false onTap() - }, this.doubleTapTreshold) + }, this.doubleTapThreshold) } _onDoubleTap = (onDoubleTap) => { @@ -508,7 +508,7 @@ class SortableGrid extends Component { _resetTapIgnoreTime = () => { clearTimeout(this.tapTimer) - this.tapTimer = setTimeout(() => this.tapIgnore = false, this.doubleTapTreshold) + this.tapTimer = setTimeout(() => this.tapIgnore = false, this.doubleTapThreshold) } createTouchHandlers = () =>