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: getting error with modal window: Exception thrown while executing UI block: Supported orientations has no common orientation with the application, and [RCTModalHostViewController shouldAutorate] is returning YES #246

Closed
vijay-dadhich09 opened this issue Nov 27, 2017 · 5 comments

Comments

@vijay-dadhich09
Copy link

I am getting following error when calling Orientation.lockToLandscape(); Any Solution?
Error:
Exception thrown while executing UI block: Supported orientations has no common orientation with the application, and [RCTModalHostViewController shouldAutorate] is returning YES

Code:
componentDidMount() {
const initial = Orientation.getInitialOrientation();
Orientation.unlockAllOrientations();
if (initial === 'PORTRAIT') {
console.log('Prtrate: ', initial);
Orientation.lockToLandscape();
} else {
console.log('landscape: ', initial);
}
}

@vijay-dadhich09
Copy link
Author

I found root cause of this issue. This is happening with modal window. My image view opening in the Modal Window and when I am changing from Portrait to landscape getting this error. Any solution?

@vijay-dadhich09
Copy link
Author

found solution... Thanks
facebook/react-native#11036

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

@vijay-dadhich09 vijay-dadhich09 changed the title ios: getting error: Exception thrown while executing UI block: Supported orientations has no common orientation with the application, and [RCTModalHostViewController shouldAutorate] is returning YES ios: getting error with modal window: Exception thrown while executing UI block: Supported orientations has no common orientation with the application, and [RCTModalHostViewController shouldAutorate] is returning YES Nov 28, 2017
@tal987
Copy link

tal987 commented Oct 25, 2018

@vijay-dadhich09 where should I add this piece of code?

@indapublic
Copy link

@tal987 You should add props to your react-native modals

@indapublic
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants