Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class Block extends Component {
<TouchableWithoutFeedback
style = {{ flex: 1 }}
delayLongPress = { this.props.delayLongPress }
onLongPress = { this.props.onLongPress }
onPress = { this.props.onPress }>
onLongPress = { () => this.props.inactive || this.props.onLongPress() }
onPress = { () => this.props.inactive || this.props.onPress() }>

<View style={styles.itemImageContainer}>
<View style={ this.props.itemWrapperStyle }>
Expand Down Expand Up @@ -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}
</Block>
Expand Down