Skip to content

Commit

Permalink
fix(datepicker): fix datepicker can't open in landscape mode bug
Browse files Browse the repository at this point in the history
add Modal supportedOrientations properties to support all orientations mode

#28
  • Loading branch information
feyy committed Feb 6, 2017
1 parent 7a451bc commit 3a9df99
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const FORMATS = {
'time': 'HH:mm'
};

const SUPPORTED_ORIENTATIONS = ["portrait", "portrait-upside-down", "landscape", "landscape-left", "landscape-right"];

class DatePicker extends Component {
constructor(props) {
super(props);
Expand Down Expand Up @@ -285,7 +287,9 @@ class DatePicker extends Component {
/>}
{Platform.OS === 'ios' && <Modal
transparent={true}
animationType="none"
visible={this.state.modalVisible}
supportedOrientations={SUPPORTED_ORIENTATIONS}
onRequestClose={() => {this.setModalVisible(false);}}
>
<View
Expand Down

0 comments on commit 3a9df99

Please sign in to comment.