Skip to content
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

iOS: Modal not showing in landscape orientation #11036

Closed
saigrandhi opened this issue Nov 20, 2016 · 6 comments
Closed

iOS: Modal not showing in landscape orientation #11036

saigrandhi opened this issue Nov 20, 2016 · 6 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@saigrandhi
Copy link
Contributor

saigrandhi commented Nov 20, 2016

Description

Modal component in iOS does not show the modal in landscape mode when the screen is in landscape mode. The screen is rotated back to portrait mode.
GIF: https://gfycat.com/BronzeSparseJunebug

Reproduction

I have provided code so that you can reproduce the bug here:
https://github.com/saigrandhi/modal_bug

Solution

I am willing to work on this bug but would like some guidance on where to start.

Additional Information

  • React Native version: 0.37.0
  • Platform: iOS
  • Operating System: MacOS
@ericvicenti
Copy link
Contributor

Yeah, Modal doesn't support this very well. Have you tried using something else? Unless you are building a hybrid application, it will be much easier to use normal View components inside the main react view. You can use ExNavigation or something similar for this use case.

Because you probably don't need to use Modal, I would consider this a feature request that can be posted on product pains. That way the rest of the community can vote on it and get the attention of the core RN team if it is important.

If want to fix this and your solution is isolated to RCTModalHostView* files, then we can probably get it reviewed pretty quickly.

@saigrandhi
Copy link
Contributor Author

Thanks for showing me where to fix this.

I have been looking through those files and it seems that a commit has been made that is specific to this issue. I will update my project to v0.38.0-rc.1 and see if it works.

@sckoh
Copy link

sckoh commented Dec 4, 2016

i found that this is not a bug, as shown on the doc Modal section
https://facebook.github.io/react-native/docs/modal.html
we need to set the supportedOrientation prop of the Modal to ['portrait', 'landscape']
in order for Modal to support landscape mode in iOS

      <Modal
        visible={true}
        supportedOrientations={['portrait', 'landscape']}
      >
      </Modal>

@edencakir
Copy link

@sckoh +1, that solves the issue. Thanks.

@markusguenther
Copy link

Cool that helps, but on android it works without this attribute in portrait and landscape mode!

@travismgibson
Copy link

@sckoh ,

Thank you. Works perfect!!!

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants