Skip to content

Commit 264aabc

Browse files
committed
Added reactNativeModalPropsIOS
1 parent 8814db2 commit 264aabc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export default class DateTimePickerTester extends Component {
7171
| customConfirmButtonIOS | node | | A custom component for the confirm button on iOS |
7272
| customTitleContainerIOS | node | | A custom component for the title container on iOS |
7373
| datePickerContainerStyleIOS | style | | The style of the container on iOS |
74+
| reactNativeModalPropsIOS | object | | Additional props for [react-native-modal](https://github.com/react-native-community/react-native-modal) on iOS |
7475
| date | obj | new Date() | Initial selected date/time |
7576
| isVisible | bool | false | Show the datetime picker? |
7677
| mode | string | 'date' | Datepicker? 'date' Timepicker? 'time' Both? 'datetime' |

src/CustomDatePickerIOS/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default class CustomDatePickerIOS extends Component {
2222
onCancel: PropTypes.func.isRequired,
2323
titleIOS: PropTypes.string,
2424
isVisible: PropTypes.bool,
25+
reactNativeModalPropsIOS: PropTypes.any,
2526
};
2627

2728
static defaultProps = {
@@ -32,6 +33,7 @@ export default class CustomDatePickerIOS extends Component {
3233
titleIOS: 'Pick a date',
3334
isVisible: false,
3435
onHideAfterConfirm: () => {},
36+
reactNativeModalPropsIOS: {},
3537
};
3638

3739
state = {
@@ -55,7 +57,7 @@ export default class CustomDatePickerIOS extends Component {
5557
_handleConfirm = () => {
5658
this.confirmed = true;
5759
this.props.onConfirm(this.state.date);
58-
}
60+
};
5961

6062
_handleOnModalHide = () => {
6163
if (this.confirmed) {
@@ -90,6 +92,7 @@ export default class CustomDatePickerIOS extends Component {
9092
contentContainerStyleIOS,
9193
customTitleContainerIOS,
9294
datePickerContainerStyleIOS,
95+
reactNativeModalPropsIOS,
9396
date,
9497
...otherProps
9598
} = this.props;
@@ -124,6 +127,7 @@ export default class CustomDatePickerIOS extends Component {
124127
isVisible={isVisible}
125128
style={[styles.contentContainer, contentContainerStyleIOS]}
126129
onModalHide={this._handleOnModalHide}
130+
{...reactNativeModalPropsIOS}
127131
>
128132
<View style={[styles.datepickerContainer, datePickerContainerStyleIOS]}>
129133
{customTitleContainerIOS || titleContainer}

0 commit comments

Comments
 (0)