diff --git a/README.md b/README.md index ef97dbf..5644c31 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,9 @@ import SortableGrid from 'react-native-sortable-grid' Function that is executed when the block is double tapped within a timeframe of ```doubleTapTreshold``` (default 150ms). Assigning this will delay the execution of ```onTap```. Omitting this will cause all taps to be handled as single taps, regardless of their frequency. + - ``` inactive ``` **Boolean** + +Flag to mark a child node as being inactive. If set, no touch events will be fired when users interact with the node. ## onDragRelease return value looks like this: diff --git a/index.js b/index.js index 1088680..0e097d0 100644 --- a/index.js +++ b/index.js @@ -29,8 +29,8 @@ class Block extends Component { + onLongPress = { () => this.props.inactive || this.props.onLongPress() } + onPress = { () => this.props.inactive || this.props.onPress() }> @@ -63,6 +63,7 @@ class SortableGrid extends Component { onPress = { this.handleTap(item.props) } itemWrapperStyle = { this._getItemWrapperStyle(key) } deletionView = { this._getDeletionView(key) } + inactive = { item.props.inactive } > {item}