-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modal does not support landscape / horizontal view #7
Comments
That looks like a great solution. Thanks @mikaello Merged PR #10 from branch support-for-landscape-view |
@mikaello RN Modal docs: |
I can't see any difference in iOS simulator between having But one thing I was thinking about adding, was a prop to |
I agree, a prop would allow users to choose how they want ModalSelector to behave 👍 |
It does not seem to work with landscape view of phone with RNMS (see also issue 41 in old repo).
In theory it is as easy as adding
supportedOrientations={['portrait', 'landscape']}
to the Modal-component, and this works as long as the orientation is fixed, but if orientation is not fixed and you turn the phone the width is not recalculated because it depends onconst { width } = Dimensions.get('window')
, and that does not change when orientation changes. See discussion and possible workarounds in react-native issue #25. You can see the problem here (the screengif program is not perfect):A fix can be to use flex to adjust size instead of
Dimensions.get('window')
:It seems to work on iOS simulator, but it should be tested on other devices as well. This attempt to fix horizontal view with flex can be tested in branch support-for-landscape-view. Add this in package.json:
"react-native-modal-selector": "peacechen/react-native-modal-selector#support-for-landscape-view"
The text was updated successfully, but these errors were encountered: