Skip to content

Commit 3a9df99

Browse files
committed
fix(datepicker): fix datepicker can't open in landscape mode bug
add Modal supportedOrientations properties to support all orientations mode #28
1 parent 7a451bc commit 3a9df99

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const FORMATS = {
2020
'time': 'HH:mm'
2121
};
2222

23+
const SUPPORTED_ORIENTATIONS = ["portrait", "portrait-upside-down", "landscape", "landscape-left", "landscape-right"];
24+
2325
class DatePicker extends Component {
2426
constructor(props) {
2527
super(props);
@@ -285,7 +287,9 @@ class DatePicker extends Component {
285287
/>}
286288
{Platform.OS === 'ios' && <Modal
287289
transparent={true}
290+
animationType="none"
288291
visible={this.state.modalVisible}
292+
supportedOrientations={SUPPORTED_ORIENTATIONS}
289293
onRequestClose={() => {this.setModalVisible(false);}}
290294
>
291295
<View

0 commit comments

Comments
 (0)