Skip to content

Commit

Permalink
Merge pull request #24 from lawnstarter/right-padding
Browse files Browse the repository at this point in the history
Right padding
  • Loading branch information
lfkwtz authored May 30, 2018
2 parents f51f54a + 1eceea7 commit 2e7f876
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# react-native-picker-select

[![npm version](https://badge.fury.io/js/react-native-picker-select.svg)](https://badge.fury.io/js/react-native-picker-select)
[![npm downloads](https://img.shields.io/npm/dm/react-native-picker-select.svg?style=flat-square)](https://www.npmjs.com/package/react-native-picker-select)
[![CircleCI](https://circleci.com/gh/lawnstarter/react-native-picker-select.svg?style=svg)](https://circleci.com/gh/lawnstarter/react-native-picker-select)

A Picker component for React Native which emulates the native `<select>` interfaces for iOS and Android
Expand All @@ -13,6 +14,10 @@ For either platform, you can alternatively pass down a child element that will b

![iOS Example](./example/ios-example.gif) ![Android Example](./example/android-example.png)

[Examples](https://github.com/lawnstarter/react-native-picker-select/tree/master/example)

[Run example.js](https://snack.expo.io/SJJaVK31X)

## Getting Started

### Installing
Expand Down Expand Up @@ -53,8 +58,6 @@ For either platform, you can alternatively pass down a child element that will b
* Alternatively, you can pass children (such as a custom button or input) for the component to wrap
* Other styles that can be modified for Android are named `viewContainer` and `placeholderColor`

[See Examples](https://github.com/lawnstarter/react-native-picker-select/tree/master/example)

## Testing

This component has been tested on React Native v0.51 - v0.55
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-picker-select",
"version": "3.0.1",
"version": "3.1.0",
"description":
"A Picker component for React Native which emulates the native <select> interfaces for each platform",
"license": "MIT",
Expand Down
12 changes: 10 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ export default class RNPickerSelect extends PureComponent {
hitSlop={{ top: 2, right: 2, bottom: 2, left: 2 }}
>
<View>
<Text style={[styles.done, this.props.style.done]}>Done</Text>
<Text style={[styles.done, this.props.style.done]}>
{this.props.doneText}
</Text>
</View>
</TouchableWithoutFeedback>
</View>
Expand All @@ -195,7 +197,11 @@ export default class RNPickerSelect extends PureComponent {
return (
<View pointerEvents="box-only">
<TextInput
style={[this.props.style.inputIOS, this.renderPlaceholderStyle()]}
style={[
!this.props.hideIcon ? { paddingRight: 30 } : {},
this.props.style.inputIOS,
this.renderPlaceholderStyle(),
]}
value={this.state.selectedItem.label}
ref={(ref) => {
this.inputRef = ref;
Expand Down Expand Up @@ -310,6 +316,7 @@ RNPickerSelect.propTypes = {
animationType: PropTypes.string,
onUpArrow: PropTypes.func,
onDownArrow: PropTypes.func,
doneText: PropTypes.string,
};

RNPickerSelect.defaultProps = {
Expand All @@ -327,6 +334,7 @@ RNPickerSelect.defaultProps = {
animationType: 'slide',
onUpArrow: null,
onDownArrow: null,
doneText: 'Done',
};

const styles = StyleSheet.create({
Expand Down

0 comments on commit 2e7f876

Please sign in to comment.