Skip to content

Commit 20b1208

Browse files
agazsogitim
authored andcommitted
Added keyboardShouldPersistTaps property (#154)
1 parent cd3b89c commit 20b1208

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ npm i react-native-sortable-list --save
3535
- **showsHorizontalScrollIndicator** (boolean) when false, the horizontal scroll indicator will not be visible. The default value is true.
3636
- **sortingEnabled?** (boolean) when false, rows are not sortable. The default value is true.
3737
- **scrollEnabled?** (boolean) when false, the content does not scrollable. The default value is true.
38+
- **keyboardShouldPersistTaps** (string)<br />
39+
Determines when the keyboard should stay visible after a tap.
40+
- '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.
41+
- 'always', the keyboard will not dismiss automatically, and the scroll view will not catch taps, but children of the scroll view can catch taps.
42+
- 'handled', the keyboard will not dismiss automatically when the tap was handled by a children, (or captured by an ancestor.<br/>
3843
- **manuallyActivateRows?** (bool) whether you intend to use the `toggleRowActive` method to activate a row or use the out of box solution.
3944
- **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.<br />
4045
- **rowActivationTime?** (number) determines time delay in ms before pressed row becomes active. Defaults to 200 ms.<br />

src/SortableList.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export default class SortableList extends Component {
3030
snapToAlignment: PropTypes.string,
3131
rowActivationTime: PropTypes.number,
3232
manuallyActivateRows: PropTypes.bool,
33+
keyboardShouldPersistTaps: PropTypes.oneOf(['never', 'always', 'handled']),
3334
scrollEventThrottle: PropTypes.number,
3435
decelerationRate: PropTypes.oneOf([PropTypes.string, PropTypes.number]),
3536
pagingEnabled: PropTypes.bool,
@@ -49,6 +50,7 @@ export default class SortableList extends Component {
4950
static defaultProps = {
5051
sortingEnabled: true,
5152
scrollEnabled: true,
53+
keyboardShouldPersistTaps: 'never',
5254
autoscrollAreaSize: 60,
5355
snapToAlignment: 'start',
5456
manuallyActivateRows: false,
@@ -220,6 +222,7 @@ export default class SortableList extends Component {
220222
pagingEnabled,
221223
nestedScrollEnabled,
222224
disableIntervalMomentum,
225+
keyboardShouldPersistTaps,
223226
} = this.props;
224227
const {animated, contentHeight, contentWidth, scrollEnabled} = this.state;
225228
const containerStyle = StyleSheet.flatten([style, {opacity: Number(animated)}])
@@ -249,6 +252,7 @@ export default class SortableList extends Component {
249252
pagingEnabled={pagingEnabled}
250253
decelerationRate={decelerationRate}
251254
scrollEnabled={scrollEnabled}
255+
keyboardShouldPersistTaps={keyboardShouldPersistTaps}
252256
showsHorizontalScrollIndicator={showsHorizontalScrollIndicator}
253257
showsVerticalScrollIndicator={showsVerticalScrollIndicator}
254258
snapToAlignment={snapToAlignment}

0 commit comments

Comments
 (0)