Skip to content

Commit

Permalink
childrenContainerStyle and touchableStyle props added (#51)
Browse files Browse the repository at this point in the history
* childrenContainerStyle and touchableStyle props added
  • Loading branch information
eduardojunio authored and peacechen committed Feb 21, 2018
1 parent fdbea99 commit 993509b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ Prop | Type | Optional | Default | Description
`cancelText` | string | Yes | `cancel` | text of the cancel button
`animationType` | string | Yes | `slide` | type of animation to be used to show the modal. Must be one of `none`, `slide` or `fade`.
`disabled` | bool | Yes | false | `true` disables opening of the modal
`childrenContainerStyle`| object | Yes | {} | style definitions for the children container view
`touchableStyle` | object | Yes | {} | style definitions for the touchable element
`supportedOrientations` | ['portrait', 'landscape'] | Yes | both | orientations the modal supports
`keyboardShouldPersistTaps`| `string` / `bool` | Yes | `always` | passed to underlying ScrollView
`style` | object | Yes | | style definitions for the root element
Expand Down
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const propTypes = {
optionTextStyle: Text.propTypes.style,
optionContainerStyle: ViewPropTypes.style,
sectionStyle: ViewPropTypes.style,
childrenContainerStyle: ViewPropTypes.style,
touchableStyle: ViewPropTypes.style,
sectionTextStyle: Text.propTypes.style,
cancelContainerStyle: ViewPropTypes.style,
cancelStyle: ViewPropTypes.style,
Expand Down Expand Up @@ -59,6 +61,8 @@ const defaultProps = {
optionTextStyle: {},
optionContainerStyle: {},
sectionStyle: {},
childrenContainerStyle: {},
touchableStyle: {},
sectionTextStyle: {},
cancelContainerStyle: {},
cancelStyle: {},
Expand Down Expand Up @@ -198,8 +202,8 @@ export default class ModalSelector extends React.Component {
return (
<View style={this.props.style}>
{dp}
<TouchableOpacity onPress={this.open} disabled={this.props.disabled}>
<View pointerEvents="none">
<TouchableOpacity style={this.props.touchableStyle} onPress={this.open} disabled={this.props.disabled}>
<View style={this.props.childrenContainerStyle} pointerEvents="none">
{this.renderChildren()}
</View>
</TouchableOpacity>
Expand Down

0 comments on commit 993509b

Please sign in to comment.