react-native-phone-number-input icon indicating copy to clipboard operation
react-native-phone-number-input copied to clipboard

Crash: Modal was presented with 0x2 orientations

Open sivantha96 opened this issue 10 months ago • 0 comments

I got this error Modal was presented with 0x2 orientations mask but the application only supports 0x18. Add more interface orientations to your app's Info. plist to fix this. NOTE: This will crash in non-dev mode.

So, I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-phone-number-input/lib/index.js b/node_modules/react-native-phone-number-input/lib/index.js
index b89c388..ddd341e 100644
--- a/node_modules/react-native-phone-number-input/lib/index.js
+++ b/node_modules/react-native-phone-number-input/lib/index.js
@@ -194,6 +194,9 @@ export default class PhoneInput extends PureComponent {
               renderFlagButton={this.renderFlagButton}
               onClose={() => this.setState({ modalVisible: false })}
               {...countryPickerProps}
+              modalProps={{
+                supportedOrientations: ["landscape", 'portrait'],
+              }}
             />
             {code && layout === "second" && (
               <Text

This issue body was partially generated by patch-package.

sivantha96 avatar Apr 03 '24 12:04 sivantha96