Skip to content

Commit d9ad661

Browse files
mikaellopeacechen
authored andcommitted
Added prop for custom styling of options container (d-a-n#21)
1 parent 860c259 commit d9ad661

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ NOTE: Due to breaking changes in React Native, RN < 0.39.0 should pass `flex:1`
9898
* `sectionTextStyle` (object, optional) style definitions for the select text element
9999
* `optionStyle` (object, optional) style definitions for the option element
100100
* `optionTextStyle` (object, optional) style definitions for the option text element
101+
* `optionContainerStyle` (object, optional) style definitions for the option container element
101102
* `cancelStyle` (object, optional) style definitions for the cancel element
102103
* `cancelTextStyle` (object, optional) style definitions for the cancel text element
103104
* `disabled` (bool, optional, default false) disable opening of the modal

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const propTypes = {
2727
selectStyle: ViewPropTypes.style,
2828
optionStyle: ViewPropTypes.style,
2929
optionTextStyle: Text.propTypes.style,
30+
optionContainerStyle: ViewPropTypes.style,
3031
sectionStyle: ViewPropTypes.style,
3132
sectionTextStyle: Text.propTypes.style,
3233
cancelStyle: ViewPropTypes.style,
@@ -46,6 +47,7 @@ const defaultProps = {
4647
selectStyle: {},
4748
optionStyle: {},
4849
optionTextStyle: {},
50+
optionContainerStyle: {},
4951
sectionStyle: {},
5052
sectionTextStyle: {},
5153
cancelStyle: {},
@@ -135,7 +137,7 @@ export default class ModalSelector extends BaseComponent {
135137

136138
return (
137139
<View style={[styles.overlayStyle, this.props.overlayStyle]} key={'modalSelector'+(componentIndex++)}>
138-
<View style={styles.optionContainer}>
140+
<View style={[styles.optionContainer, this.props.optionContainerStyle]}>
139141
<ScrollView keyboardShouldPersistTaps={this.props.keyboardShouldPersistTaps}>
140142
<View style={{paddingHorizontal: 10}}>
141143
{options}

0 commit comments

Comments
 (0)