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

Picker Item is not listed on IOS #550

Open
JoezerSmaniotto opened this issue Mar 6, 2024 · 10 comments
Open

Picker Item is not listed on IOS #550

JoezerSmaniotto opened this issue Mar 6, 2024 · 10 comments

Comments

@JoezerSmaniotto
Copy link

I'm using Picker (@react-native-picker/picker) in a form, but on IOS it doesn't display the Picker.Items, on Android it worked perfectly estou usando a versão "@react-native-picker/picker": "2.4.10" e estou usando o "expo": "^49.0.0",

<InputContainer> <Label>{t('signIn.broker')}</Label> <Controller control={control} rules={{ required: true }} render={({ field: { onChange, onBlur, value } }) => ( <ContainerSelect> <Picker enabled={!isSubmitting && loadBrokers} selectedValue={value} onValueChange={onChange} onBlur={onBlur} style={{ backgroundColor: theme.colors.mediumGray, color: theme.colors.lightGray, height: 48, fontSize: 16 }} dropdownIconColor="white" dropdownIconRippleColor={theme.colors.mediumGray}> <Picker.Item label="" value="" /> {brokers.map((item: broker) => { return <Picker.Item label={item.nameDisplay} value={item.name} key={item.nameDisplay} />; })} </Picker> </ContainerSelect> )} name="broker" /> {errors.broker && <ErrorText>{errors.broker.message}</ErrorText>} </InputContainer>

"In the broker input, it should present a listing"

Picker

Pickercode

@sairamchow5555
Copy link

After installation of module run pod install

refer:
https://www.npmjs.com/package/@react-native-picker/picker

@JoezerSmaniotto
Copy link
Author

@sairamchow5555 But is expo-managed flow necessary when doing so?

@sairamchow5555
Copy link

sairamchow5555 commented Mar 7, 2024

you can try to use the Selector from the native-base which also works similar to the react-native-picker/picker

@scotttiger123
Copy link

its still not working using pod intstall on IOS any help ?

@JoezerSmaniotto
Copy link
Author

I ended up creating the component by hand, considering it was having problems

@iamjoshua
Copy link

iamjoshua commented May 1, 2024

I can confirm that no items are rendered after following the install instructions within a clean install of the latest version of Expo 50.0.17 on iOS. What seems to be required is a parent View immediately around the picker, otherwise nothing will be rendered even if placed on a screen with other elements.

@fjerbi
Copy link

fjerbi commented May 16, 2024

Same issue, here, Items are not rendered in IOS, any fixes or suggestions?

@augustosamame
Copy link

augustosamame commented May 21, 2024

I can confirm that no items are rendered after following the install instructions within a clean install of the latest version of Expo 50.0.17 on iOS. What seems to be required is a parent View immediately around the picker, otherwise nothing will be rendered even if placed on a screen with other elements.

H! Can you elaborate on your workaround? I have put the Picker inside a View, but still not showing up in my Expo 50 project.

@Serdnad
Copy link

Serdnad commented Jun 13, 2024

Surrounding the Picker in a View with an explicit width set did it for me. E.g.

<View style={{ width: "100%" }}>
  <PickerIOS>...</PickerIOS>
</View>

@farzadali3
Copy link

Defining the width property in itemStyle prop of Picker would solve the issue of Picker items not appearing on the screen.


import { Picker } from '@react-native-picker/picker';

<Picker
  selectedValue={this.state.location}
  itemStyle={{ width: 150 }}  // Define width in itemStyle
>
  <Picker.Item label="Location 1" value="1" /> 
  <Picker.Item label="Location 2" value="2" />
  <Picker.Item label="Location 3" value="3" />
</Picker>

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

8 participants