Skip to content

Commit 880e5fb

Browse files
committed
Add prop keyboardShouldPersistTaps to pass to ScrollView.
1 parent 3bf0b7c commit 880e5fb

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
'use strict';
22

3-
import React,{
4-
PropTypes
5-
} from 'react';
3+
import React from 'react';
4+
import PropTypes from 'prop-types';
65

76
import {
87
View,
@@ -33,7 +32,8 @@ const propTypes = {
3332
cancelStyle: View.propTypes.style,
3433
cancelTextStyle: Text.propTypes.style,
3534
overlayStyle: View.propTypes.style,
36-
cancelText: PropTypes.string
35+
cancelText: PropTypes.string,
36+
keyboardShouldPersistTaps: PropTypes.oneOfType([PropTypes.string, PropTypes.bool])
3737
};
3838

3939
const defaultProps = {
@@ -49,7 +49,8 @@ const defaultProps = {
4949
cancelStyle: {},
5050
cancelTextStyle: {},
5151
overlayStyle: {},
52-
cancelText: 'cancel'
52+
cancelText: 'cancel',
53+
keyboardShouldPersistTaps: 'always'
5354
};
5455

5556
export default class ModalPicker extends BaseComponent {
@@ -131,7 +132,7 @@ export default class ModalPicker extends BaseComponent {
131132
return (
132133
<View style={[styles.overlayStyle, this.props.overlayStyle]} key={'modalPicker'+(componentIndex++)}>
133134
<View style={styles.optionContainer}>
134-
<ScrollView keyboardShouldPersistTaps>
135+
<ScrollView keyboardShouldPersistTaps={this.props.keyboardShouldPersistTaps}>
135136
<View style={{paddingHorizontal:10}}>
136137
{options}
137138
</View>

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
"android",
2323
"react-component"
2424
],
25+
"dependencies": {
26+
"prop-types": "^15.5.10"
27+
},
2528
"author": "Daniel Korger <[email protected]>",
2629
"contributors": [
2730
{

0 commit comments

Comments
 (0)