question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Picker on IOS in landscape mode rotates to portrait after selecting item

See original GitHub issue

I have gone through these following points

Issue Description

Open app in Landscape mode and go to Picker. Click Picker, new screen with options opens. Select an option from the Picker items in the new screen.

node, npm, react-native, react and native-base version, expo version if used, xcode version

"expo": "^34.0.4",
"native-base": "^2.13.5",
"react": "^16.8.3",
"react-native": "^0.59.8",

Expected behaviour

After selecting an option you return to the main screen in the orientation you were before (Landscape)

Actual behaviour

App orientation is set to Portrait.

Steps to reproduce

import React, { useState, useEffect } from 'react';
import {
  Body, Right, Left, Icon, Header, Button, Title, Picker, View
} from 'native-base';

function LanguagePicker() {
  const [language, setLanguage] = useState( 'nl');

  function handleChangeLanguage(value) {
    setLanguage(value);
  }

  return (
    <View style={{flex: 1, height: '100%', justifyContent: 'center'}}>
    <Picker
      mode="dropdown"
      iosHeader="Select language"
      iosIcon={<Icon name="arrow-down" />}
      placeholder="Select language"
      placeholderStyle={{ color: '#000' }}
      style={{ width: '100%' }}
      itemTextStyle={{ color: '#000000' }}
      selectedValue={language}
      onValueChange={value => handleChangeLanguage(value)}
    >
      <Picker.Item label="Nederlands" key="0" value="nl" />
      <Picker.Item label="English" key="1" value="en" />
    </Picker>
    </View>
  );
}

export default LanguagePicker;

Is the bug present in both iOS and Android or in any one of them?

Only IOS, and only when in Landscape.

I tested this also on snack.expo (with own device, snack has only portrait mode!). Here is link to code: https://snack.expo.io/@anniekvandijk/language-dropdown

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sankhadeeproy007commented, Sep 3, 2019

modal Tested on react-native 60.5. Are you sure it’s not an expo issue?

0reactions
hanykumarcommented, Aug 18, 2020

Hi @anniekvandijk , as we have tested it and found no issue, closing this now. Let us know if the issue still persists.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rotate the screen on your iPhone or iPod touch - Apple Support
Swipe down from the top-right corner of your screen to open Control Center. Tap the Portrait Orientation Lock button to make sure that...
Read more >
How to change the UIImage picker camera orientation to ...
The issue is my UIImagePicker gets open perfectly in all orientation but the camera gets rotated 90 degree and comes in half screen...
Read more >
Enabling Orientation Changes for Selected View Controllers
One of the features in our app is Charts, which can be viewed in portrait and landscape mode. Also when the device rotates...
Read more >
Working With Device Rotations
Rotations on Devices. iPhone. ○ Support rotation if it complements the design. ○ Camera app supports landscape and portrait. ○ Weather app only...
Read more >
My iPhone or iPad Screen Won't Rotate. How Do I Fix It?
If your iPhone display is stuck in portrait and won't rotate to landscape even when you hold your handset sideways, the Portrait Orientation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found