ScreenOrientation.lockAsync not working while modal open

Please provide the following:

  1. SDK Version: expo v39.0.0
  2. Platforms(Android/iOS/web/all): iOS

does not work when Modal from ‘react-native’ is visible.
The app was in landscape, but when Modal opens, the app instantly turn back to portrait.

I see same issue. If my app is in landscape and I tap on a modal the entire app switches to portrait and modal opens.

You should use the supportedOrientations prop - Modal · React Native

if using react-native-elements add this:

supportedOrientations={['portrait', 'landscape']}

see here for more details.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.