Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support rn 0.51 #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[![npm version](https://badge.fury.io/js/react-native-modal-picker.svg)](https://badge.fury.io/js/react-native-modal-picker)

# react-native-modal-picker
Requires react-native >= 0.51.0.

A cross-platform (iOS / Android), selector/picker component for React Native that is highly customizable and supports sections.

## Demo
Expand Down
16 changes: 9 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use strict';

import React,{
PropTypes
} from 'react';
import React from 'react';
import PropTypes from 'prop-types';

import {
View,
Expand All @@ -12,6 +11,7 @@ import {
Text,
ScrollView,
TouchableOpacity,
TouchableHighlight,
Platform
} from 'react-native';

Expand Down Expand Up @@ -131,7 +131,7 @@ export default class ModalPicker extends BaseComponent {
return (
<View style={[styles.overlayStyle, this.props.overlayStyle]} key={'modalPicker'+(componentIndex++)}>
<View style={styles.optionContainer}>
<ScrollView keyboardShouldPersistTaps>
<ScrollView keyboardShouldPersistTaps="always">
<View style={{paddingHorizontal:10}}>
{options}
</View>
Expand Down Expand Up @@ -163,9 +163,11 @@ export default class ModalPicker extends BaseComponent {
render() {

const dp = (
<Modal transparent={true} ref="modal" visible={this.state.modalVisible} onRequestClose={this.close} animationType={this.state.animationType}>
{this.renderOptionList()}
</Modal>
<Modal transparent={true} ref="modal" visible={this.state.modalVisible} onRequestClose={this.close} animationType={this.state.animationType}>
<TouchableHighlight onPress={this.close}>
{this.renderOptionList()}
</TouchableHighlight>
</Modal>
);

return (
Expand Down