Skip to content

Commit

Permalink
Merge pull request #21 from lawnstarter/chevron-styles
Browse files Browse the repository at this point in the history
allow chevron style changes
  • Loading branch information
lfkwtz authored May 4, 2018
2 parents 76654e4 + c02097a commit f51f54a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default class RNPickerSelect extends PureComponent {
return;
}
this.setState({
animationType: animate ? 'slide' : undefined,
animationType: animate ? this.props.animationType : undefined,
showPicker: !this.state.showPicker,
});
if (!this.state.showPicker && this.inputRef) {
Expand Down Expand Up @@ -139,8 +139,12 @@ export default class RNPickerSelect extends PureComponent {
<View
style={[
styles.chevron,
this.props.style.chevron,
styles.chevronUp,
this.props.onUpArrow ? styles.chevronActive : {},
this.props.style.chevronUp,
this.props.onUpArrow
? [styles.chevronActive, this.props.style.chevronActive]
: {},
]}
/>
</TouchableOpacity>
Expand All @@ -152,8 +156,12 @@ export default class RNPickerSelect extends PureComponent {
<View
style={[
styles.chevron,
this.props.style.chevron,
styles.chevronDown,
this.props.onDownArrow ? styles.chevronActive : {},
this.props.style.chevronDown,
this.props.onDownArrow
? [styles.chevronActive, this.props.style.chevronActive]
: {},
]}
/>
</TouchableOpacity>
Expand Down Expand Up @@ -299,6 +307,7 @@ RNPickerSelect.propTypes = {
style: PropTypes.object, // eslint-disable-line react/forbid-prop-types
children: PropTypes.any, // eslint-disable-line react/forbid-prop-types
mode: PropTypes.string,
animationType: PropTypes.string,
onUpArrow: PropTypes.func,
onDownArrow: PropTypes.func,
};
Expand All @@ -315,6 +324,7 @@ RNPickerSelect.defaultProps = {
style: {},
children: null,
mode: 'dialog',
animationType: 'slide',
onUpArrow: null,
onDownArrow: null,
};
Expand Down

0 comments on commit f51f54a

Please sign in to comment.