diff --git a/README.md b/README.md index 19d3859..8864f67 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,11 @@ npm i react-native-sortable-list --save - **showsHorizontalScrollIndicator** (boolean) when false, the horizontal scroll indicator will not be visible. The default value is true. - **sortingEnabled?** (boolean) when false, rows are not sortable. The default value is true. - **scrollEnabled?** (boolean) when false, the content does not scrollable. The default value is true. +- **keyboardShouldPersistTaps** (string)
+Determines when the keyboard should stay visible after a tap. + - 'never' (the default), tapping outside of the focused text input when the keyboard is up dismisses the keyboard. When this happens, children won't receive the tap. + - 'always', the keyboard will not dismiss automatically, and the scroll view will not catch taps, but children of the scroll view can catch taps. + - 'handled', the keyboard will not dismiss automatically when the tap was handled by a children, (or captured by an ancestor.
- **manuallyActivateRows?** (bool) whether you intend to use the `toggleRowActive` method to activate a row or use the out of box solution. - **autoscrollAreaSize?** (number) determines the height for vertical list and the width for horizontal list of the area at the begining and the end of the list that will trigger autoscrolling. Defaults to 60.
- **rowActivationTime?** (number) determines time delay in ms before pressed row becomes active. Defaults to 200 ms.
diff --git a/src/SortableList.js b/src/SortableList.js index f866cc9..78cd576 100644 --- a/src/SortableList.js +++ b/src/SortableList.js @@ -30,6 +30,7 @@ export default class SortableList extends Component { snapToAlignment: PropTypes.string, rowActivationTime: PropTypes.number, manuallyActivateRows: PropTypes.bool, + keyboardShouldPersistTaps: PropTypes.oneOf(['never', 'always', 'handled']), scrollEventThrottle: PropTypes.number, decelerationRate: PropTypes.oneOf([PropTypes.string, PropTypes.number]), pagingEnabled: PropTypes.bool, @@ -49,6 +50,7 @@ export default class SortableList extends Component { static defaultProps = { sortingEnabled: true, scrollEnabled: true, + keyboardShouldPersistTaps: 'never', autoscrollAreaSize: 60, snapToAlignment: 'start', manuallyActivateRows: false, @@ -220,6 +222,7 @@ export default class SortableList extends Component { pagingEnabled, nestedScrollEnabled, disableIntervalMomentum, + keyboardShouldPersistTaps, } = this.props; const {animated, contentHeight, contentWidth, scrollEnabled} = this.state; const containerStyle = StyleSheet.flatten([style, {opacity: Number(animated)}]) @@ -249,6 +252,7 @@ export default class SortableList extends Component { pagingEnabled={pagingEnabled} decelerationRate={decelerationRate} scrollEnabled={scrollEnabled} + keyboardShouldPersistTaps={keyboardShouldPersistTaps} showsHorizontalScrollIndicator={showsHorizontalScrollIndicator} showsVerticalScrollIndicator={showsVerticalScrollIndicator} snapToAlignment={snapToAlignment}